Skip to content

Commit

Permalink
media: v4l2-ioctl.c: fix missing unlock in __video_do_ioctl()
Browse files Browse the repository at this point in the history
If dev_debug was active, then the code could return without unlocking the
core mutex. Replace the return with a 'goto unlock' to ensure proper unlocking.

Fixes: 73a1106 ("v4l2-core: push taking ioctl mutex down to ioctl handler")

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 5, 2018
1 parent 8cbc3a8 commit 5983d3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/v4l2-core/v4l2-ioctl.c
Original file line number Diff line number Diff line change
@@ -2777,7 +2777,7 @@ static long __video_do_ioctl(struct file *file,
if (dev_debug & (V4L2_DEV_DEBUG_IOCTL | V4L2_DEV_DEBUG_IOCTL_ARG)) {
if (!(dev_debug & V4L2_DEV_DEBUG_STREAMING) &&
(cmd == VIDIOC_QBUF || cmd == VIDIOC_DQBUF))
return ret;
goto unlock;

v4l_printk_ioctl(video_device_node_name(vfd), cmd);
if (ret < 0)

0 comments on commit 5983d3b

Please sign in to comment.