[PATCH 0/2] usb: gadget: uvc: fix resource leak on video->async_wq and video->kworker

From: Xu Yang

Date: Fri Aug 21 2026 - 04:20:21 EST


This patchset fixes the resource leak issue on uvc_function_bind() error
handling path and uvc_function_unbind(). For the former, video->async_wq
and video->kworker may never be destroyed. For the latter, video->kworker
needs to be destroyed.

Besides, patch#1 also fixes incorrect goto labels that could clean up
resources not yet initialized.

Signed-off-by: Xu Yang <xu.yang_2@xxxxxxx>
---
Xu Yang (2):
usb: gadget: uvc: replace mutex lock/unlock with scoped_guard in uvc_function_bind()
usb: gadget: uvc: refactor video cleanup into uvcg_video_deinit()

drivers/usb/gadget/function/f_uvc.c | 87 ++++++++++++++-------------------
drivers/usb/gadget/function/uvc_video.c | 15 ++++++
drivers/usb/gadget/function/uvc_video.h | 1 +
3 files changed, 54 insertions(+), 49 deletions(-)
---
base-commit: e1e6e541c5c9cf548e9fdc35fc26808c82074440
change-id: 20260819-usb-uvc-fixes-3176195c148a

Best regards,
--
Xu Yang <xu.yang_2@xxxxxxx>