提交 8f695d3f 编写于 作者: E Ezequiel García 提交者: Mauro Carvalho Chehab

[media] v4l2-dev.c: Move video_put() after debug printk

It is possible that video_put() releases video_device struct,
provoking a panic when debug printk wants to get video_device node name.
Signed-off-by: NEzequiel Garcia <elezegarcia@gmail.com>
Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 cd779254
......@@ -478,12 +478,12 @@ static int v4l2_open(struct inode *inode, struct file *filp)
}
err:
/* decrease the refcount in case of an error */
if (ret)
video_put(vdev);
if (vdev->debug)
printk(KERN_DEBUG "%s: open (%d)\n",
video_device_node_name(vdev), ret);
/* decrease the refcount in case of an error */
if (ret)
video_put(vdev);
return ret;
}
......@@ -500,12 +500,12 @@ static int v4l2_release(struct inode *inode, struct file *filp)
if (test_bit(V4L2_FL_LOCK_ALL_FOPS, &vdev->flags))
mutex_unlock(vdev->lock);
}
/* decrease the refcount unconditionally since the release()
return value is ignored. */
video_put(vdev);
if (vdev->debug)
printk(KERN_DEBUG "%s: release\n",
video_device_node_name(vdev));
/* decrease the refcount unconditionally since the release()
return value is ignored. */
video_put(vdev);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册