hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/usb/gadget/function/f_uvc.c
....@@ -586,6 +586,7 @@
586586 int ret;
587587
588588 /* TODO reference counting. */
589
+ memset(&uvc->vdev, 0, sizeof(uvc->vdev));
589590 uvc->vdev.v4l2_dev = &uvc->v4l2_dev;
590591 uvc->vdev.fops = &uvc_v4l2_fops;
591592 uvc->vdev.ioctl_ops = &uvc_v4l2_ioctl_ops;
....@@ -1198,10 +1199,14 @@
11981199 {
11991200 struct usb_composite_dev *cdev = c->cdev;
12001201 struct uvc_device *uvc = to_uvc(f);
1202
+ struct uvc_video *video = &uvc->video;
12011203 long wait_ret = 1;
12021204
12031205 uvcg_info(f, "%s()\n", __func__);
12041206
1207
+ if (video->async_wq)
1208
+ destroy_workqueue(video->async_wq);
1209
+
12051210 /* If we know we're connected via v4l2, then there should be a cleanup
12061211 * of the device from userspace either via UVC_EVENT_DISCONNECT or
12071212 * though the video device removal uevent. Allow some time for the