diff mbox

mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken

Message ID 201010151045.45630.hverkuil@xs4all.nl (mailing list archive)
State Not Applicable
Headers show

Commit Message

Hans Verkuil Oct. 15, 2010, 8:45 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c                                                         
index 32575a6..26d39c4 100644                                                                                                        
--- a/drivers/media/video/v4l2-dev.c                                                                                                 
+++ b/drivers/media/video/v4l2-dev.c                                                                                                 
@@ -222,8 +222,8 @@  static int v4l2_ioctl(struct inode *inode, struct file *filp,                                                    
                                                                                                                                     
        if (!vdev->fops->ioctl)                                                                                                      
                return -ENOTTY;                                                                                                      
-       /* Allow ioctl to continue even if the device was unregistered.                                                              
-          Things like dequeueing buffers might still be useful. */
+       if (!video_is_registered(vdev))
+               return -ENODEV;
        return vdev->fops->ioctl(filp, cmd, arg);
 }
 
@@ -234,8 +234,8 @@  static long v4l2_unlocked_ioctl(struct file *filp,
 
        if (!vdev->fops->unlocked_ioctl)
                return -ENOTTY;
-       /* Allow ioctl to continue even if the device was unregistered.
-          Things like dequeueing buffers might still be useful. */
+       if (!video_is_registered(vdev))
+               return -ENODEV;
        return vdev->fops->unlocked_ioctl(filp, cmd, arg);
 }