Re: [PATCH] usb: gadget: f_tcm: Fix NULL pointer dereferences in nexus handling

From: Sebastian Andrzej Siewior

Date: Wed Feb 18 2026 - 02:29:36 EST


On 2026-02-18 05:22:21 [+0000], Thinh Nguyen wrote:
> > Fixes: 08a1cb0f65fd ("usb: gadget: tcm: factor out f_tcm")
> > Signed-off-by: Jiasheng Jiang <jiashengjiangcool@xxxxxxxxx>

> While the patch itself is fine, we should prevent this situation from
> occurring in the first place. That is, we should enforce the config
> dependency and prevent the users from removing the nexus if the gadget
> driver is bound. Likewise, we should prevent the gadget driver from
> binding if no nexus is established.

Is this an actual problem or just something that looks like it could
happen? My memory is that the tcm holds a reference on it and the
referenced commit just split/moved the code. So if it is a problem then
it should have been there longer than that.

> BR,
> Thinh

Sebastian