aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-10-09 16:43:40 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 01:16:58 -0200
commit7242063018c06977dc6825026b3075076e6f227b (patch)
tree3d1a33e60443774cf5199c6bc6ee4b76f4d57ac3 /drivers/media/video/v4l2-dev.c
parentbe737a826949760b75c3b46fc86686274965fca1 (diff)
V4L/DVB: Fix a merge conflict that affects unlock_ioctl
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r--drivers/media/video/v4l2-dev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index a7702e3d149..0ca7978654b 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -236,20 +236,20 @@ static unsigned int v4l2_poll(struct file *filp, struct poll_table_struct *poll)
static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct video_device *vdev = video_devdata(filp);
- int ret;
+ int ret = -ENODEV;
- if (!vdev->fops->ioctl)
- return -ENOTTY;
if (vdev->fops->unlocked_ioctl) {
if (vdev->lock)
mutex_lock(vdev->lock);
- ret = vdev->fops->unlocked_ioctl(filp, cmd, arg);
+ if (video_is_registered(vdev))
+ ret = vdev->fops->unlocked_ioctl(filp, cmd, arg);
if (vdev->lock)
mutex_unlock(vdev->lock);
} else if (vdev->fops->ioctl) {
/* TODO: convert all drivers to unlocked_ioctl */
lock_kernel();
- ret = vdev->fops->ioctl(filp, cmd, arg);
+ if (video_is_registered(vdev))
+ ret = vdev->fops->ioctl(filp, cmd, arg);
unlock_kernel();
} else
ret = -ENOTTY;