From: Jiri Slaby Date: Tue, 23 Dec 2008 01:38:23 +0000 (-0300) Subject: V4L/DVB (9972): v4l: usbvideo, fix module ref count check X-Git-Tag: v2.6.29-rc1~556^2~134 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=be49e368fb6e20c3a90c566b040ac3d248e2ce29;p=linux-2.6-omap-h63xx.git V4L/DVB (9972): v4l: usbvideo, fix module ref count check usbvideo_ClientIncModCount may return value < 0 in the case of error, not > 0. Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c index a42049de2bb..148a1f98c70 100644 --- a/drivers/media/video/usbvideo/usbvideo.c +++ b/drivers/media/video/usbvideo/usbvideo.c @@ -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);