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

Xu Yang posted 2 patches 1 day, 1 hour ago
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(-)
[PATCH v2 0/2] usb: gadget: uvc: fix resource leak on video->async_wq and video->kworker
Posted by Xu Yang 1 day, 1 hour ago
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@nxp.com>
---
Changes in v2:
- rebase to latest usb-testing
- add sob tags
- Link to v1: https://patch.msgid.link/20260821-usb-uvc-fixes-v1-0-80e6e279523d@nxp.com

---
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: d58dffe9ee2c8883193959ff4ef995ec07932874
change-id: 20260819-usb-uvc-fixes-3176195c148a

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