V4L/DVB (9972): v4l: usbvideo, fix module ref count check
authorJiri Slaby <jirislaby@gmail.com>
Tue, 23 Dec 2008 01:38:23 +0000 (22:38 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 30 Dec 2008 11:39:34 +0000 (09:39 -0200)
usbvideo_ClientIncModCount may return value < 0 in the case of error, not > 0.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/usbvideo/usbvideo.c

index a42049de2bb680560c4cafc069a1bcd19956943d..148a1f98c70f714e46f0af650a49268f5d07ae59 100644 (file)
@@ -1123,7 +1123,7 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
        if (uvd->debug > 1)
                dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, dev);
 
-       if (0 < usbvideo_ClientIncModCount(uvd))
+       if (usbvideo_ClientIncModCount(uvd) < 0)
                return -ENODEV;
        mutex_lock(&uvd->lock);