V4L/DVB (5019): Fix the frame->grabstate update in read() entry point.
authorThierry MERLE <thierry.merle@free.fr>
Fri, 29 Dec 2006 23:32:08 +0000 (20:32 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 15 Jan 2007 18:25:24 +0000 (16:25 -0200)
The Coverity checker spotted that in usbvision_v4l2_read(), the variable
"frmx" is never assigned any value different from -1, but it's used an
an array index in "usbvision->frame[frmx]".
Thanks to Adrian Bunk <bunk@stusta.de> for warning about that.

Signed-off-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/usbvision/usbvision-video.c

index 8c7eba2a728e16fb3f041780f43a3c9370b8843c..7243337b771a5031b54ec861d1cd6fc1e7e25d25 100644 (file)
@@ -1080,7 +1080,6 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf,
        int noblock = file->f_flags & O_NONBLOCK;
        unsigned long lock_flags;
 
-       int frmx = -1;
        int ret,i;
        struct usbvision_frame *frame;
 
@@ -1155,7 +1154,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf,
                frame->bytes_read = 0;
 
                /* Mark it as available to be used again. */
-               usbvision->frame[frmx].grabstate = FrameState_Unused;
+               frame->grabstate = FrameState_Unused;
 /*     } */
 
        return count;