提交 5983d3bc 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

media: v4l2-ioctl.c: fix missing unlock in __video_do_ioctl()

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: 73a11062 ("v4l2-core: push taking ioctl mutex down to ioctl handler")
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 8cbc3a85
...@@ -2777,7 +2777,7 @@ static long __video_do_ioctl(struct file *file, ...@@ -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_IOCTL | V4L2_DEV_DEBUG_IOCTL_ARG)) {
if (!(dev_debug & V4L2_DEV_DEBUG_STREAMING) && if (!(dev_debug & V4L2_DEV_DEBUG_STREAMING) &&
(cmd == VIDIOC_QBUF || cmd == VIDIOC_DQBUF)) (cmd == VIDIOC_QBUF || cmd == VIDIOC_DQBUF))
return ret; goto unlock;
v4l_printk_ioctl(video_device_node_name(vfd), cmd); v4l_printk_ioctl(video_device_node_name(vfd), cmd);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册