Skip to content

Commit 65e6a27

Browse files
Benjamin GaignardHans Verkuil
authored andcommitted
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: c838530 ("media: media videobuf2: Be more flexible on the number of queue stored buffers") Fixes: f3d27f3 ("[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]
1 parent bfb1b99 commit 65e6a27

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

drivers/media/usb/usbtv/usbtv-video.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -963,15 +963,8 @@ int usbtv_video_init(struct usbtv *usbtv)
963963

964964
void usbtv_video_free(struct usbtv *usbtv)
965965
{
966-
mutex_lock(&usbtv->vb2q_lock);
967-
mutex_lock(&usbtv->v4l2_lock);
968-
969-
usbtv_stop(usbtv);
970966
vb2_video_unregister_device(&usbtv->vdev);
971967
v4l2_device_disconnect(&usbtv->v4l2_dev);
972968

973-
mutex_unlock(&usbtv->v4l2_lock);
974-
mutex_unlock(&usbtv->vb2q_lock);
975-
976969
v4l2_device_put(&usbtv->v4l2_dev);
977970
}

0 commit comments

Comments
 (0)