提交 c430ca1e 编写于 作者: T Thierry MERLE 提交者: Mauro Carvalho Chehab

V4L/DVB (5019): Fix the frame->grabstate update in read() entry point.

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: NThierry MERLE <thierry.merle@free.fr>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 a8b34852
...@@ -1080,7 +1080,6 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf, ...@@ -1080,7 +1080,6 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf,
int noblock = file->f_flags & O_NONBLOCK; int noblock = file->f_flags & O_NONBLOCK;
unsigned long lock_flags; unsigned long lock_flags;
int frmx = -1;
int ret,i; int ret,i;
struct usbvision_frame *frame; struct usbvision_frame *frame;
...@@ -1155,7 +1154,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf, ...@@ -1155,7 +1154,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf,
frame->bytes_read = 0; frame->bytes_read = 0;
/* Mark it as available to be used again. */ /* Mark it as available to be used again. */
usbvision->frame[frmx].grabstate = FrameState_Unused; frame->grabstate = FrameState_Unused;
/* } */ /* } */
return count; return count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册