summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/usbtv
diff options
context:
space:
mode:
authorBenjamin Gaignard <benjamin.gaignard@collabora.com>2024-03-02 11:37:08 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-03-04 12:58:38 +0100
commit65e6a2773d655172143cc0b927cdc89549842895 (patch)
tree025ce3492b1eb5498f47cce1ba9754664a565588 /drivers/media/usb/usbtv
parentmedia: mediatek: vcodec: avoid -Wcast-function-type-strict warning (diff)
downloadlinux-65e6a2773d655172143cc0b927cdc89549842895.tar.xz
linux-65e6a2773d655172143cc0b927cdc89549842895.zip
media: usbtv: Remove useless locks in usbtv_video_free()
Remove locks calls in usbtv_video_free() because are useless and may led to a deadlock as reported here: https://syzkaller.appspot.com/x/bisect.txt?x=166dc872180000 Also remove usbtv_stop() call since it will be called when unregistering the device. Before 'c838530d230b' this issue would only be noticed if you disconnect while streaming and now it is noticeable even when disconnecting while not streaming. Fixes: c838530d230b ("media: media videobuf2: Be more flexible on the number of queue stored buffers") Fixes: f3d27f34fdd7 ("[media] usbtv: Add driver for Fushicai USBTV007 video frame grabber") Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: fix minor spelling mistake in log message]
Diffstat (limited to 'drivers/media/usb/usbtv')
-rw-r--r--drivers/media/usb/usbtv/usbtv-video.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/media/usb/usbtv/usbtv-video.c b/drivers/media/usb/usbtv/usbtv-video.c
index 62a583040cd4..702f1c8bd2ab 100644
--- a/drivers/media/usb/usbtv/usbtv-video.c
+++ b/drivers/media/usb/usbtv/usbtv-video.c
@@ -963,15 +963,8 @@ ctrl_fail:
void usbtv_video_free(struct usbtv *usbtv)
{
- mutex_lock(&usbtv->vb2q_lock);
- mutex_lock(&usbtv->v4l2_lock);
-
- usbtv_stop(usbtv);
vb2_video_unregister_device(&usbtv->vdev);
v4l2_device_disconnect(&usbtv->v4l2_dev);
- mutex_unlock(&usbtv->v4l2_lock);
- mutex_unlock(&usbtv->vb2q_lock);
-
v4l2_device_put(&usbtv->v4l2_dev);
}