Skip to content

Commit

Permalink
V4L/DVB (9972): v4l: usbvideo, fix module ref count check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent 14983d8 commit be49e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/usbvideo/usbvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit be49e36

Please sign in to comment.