Re: [syzbot] [media?] [usb?] INFO: task hung in vb2_video_unregister_device

Lizhi Xu
2024-02-29T07:20:28Z

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index c575198e8354..437f80551a2d 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -1262,8 +1262,7 @@ void vb2_video_unregister_device(struct video_device *vdev)
get_device(&vdev->dev);
video_unregister_device(vdev);
if (vdev->queue) {
- struct mutex *lock = vdev->queue->lock ?
- vdev->queue->lock : vdev->lock;
+ struct mutex *lock = vdev->queue->lock;

if (lock)
mutex_lock(lock);