.. | .. |
---|
586 | 586 | int ret; |
---|
587 | 587 | |
---|
588 | 588 | /* TODO reference counting. */ |
---|
| 589 | + memset(&uvc->vdev, 0, sizeof(uvc->vdev)); |
---|
589 | 590 | uvc->vdev.v4l2_dev = &uvc->v4l2_dev; |
---|
590 | 591 | uvc->vdev.fops = &uvc_v4l2_fops; |
---|
591 | 592 | uvc->vdev.ioctl_ops = &uvc_v4l2_ioctl_ops; |
---|
.. | .. |
---|
1198 | 1199 | { |
---|
1199 | 1200 | struct usb_composite_dev *cdev = c->cdev; |
---|
1200 | 1201 | struct uvc_device *uvc = to_uvc(f); |
---|
| 1202 | + struct uvc_video *video = &uvc->video; |
---|
1201 | 1203 | long wait_ret = 1; |
---|
1202 | 1204 | |
---|
1203 | 1205 | uvcg_info(f, "%s()\n", __func__); |
---|
1204 | 1206 | |
---|
| 1207 | + if (video->async_wq) |
---|
| 1208 | + destroy_workqueue(video->async_wq); |
---|
| 1209 | + |
---|
1205 | 1210 | /* If we know we're connected via v4l2, then there should be a cleanup |
---|
1206 | 1211 | * of the device from userspace either via UVC_EVENT_DISCONNECT or |
---|
1207 | 1212 | * though the video device removal uevent. Allow some time for the |
---|