Re: [PATCH] usb: gadget: fix null pointer dereference in usb_put_function_instance()
From: Jeffin Philip
Date: Thu Aug 27 2026 - 00:38:54 EST
On Sun, 16 Aug 2026 11:47:12 +0530, Jeffin Philip wrote:
>usb_put_function_instance() attempts to dereference fd inside fi struct
>to get mod in uvc_alloc_inst() error path. However, fd is not allocated
>until later in try_get_usb_function_instance() after allocating fi in
>uvc_alloc_inst() and thus guranteed to be null in error path. Fix this
>by adding a null check for fi->fd that returns if fd is null.
Friendly ping, let me know if you want me to fix anything.
Thanks.
Jeffin.