diff options
author | Thierry MERLE <thierry.merle@free.fr> | 2006-12-29 18:32:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-01-15 13:25:24 -0500 |
commit | c430ca1e16b2b4b30f567806c73e270caea8db1d (patch) | |
tree | d939818fb6d6e3abfd5ababdd014179b410b2cec /drivers/media | |
parent | a8b3485287731978899ced11f24628c927890e78 (diff) |
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: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 8c7eba2a728e..7243337b771a 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -1080,7 +1080,6 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf, | |||
1080 | int noblock = file->f_flags & O_NONBLOCK; | 1080 | int noblock = file->f_flags & O_NONBLOCK; |
1081 | unsigned long lock_flags; | 1081 | unsigned long lock_flags; |
1082 | 1082 | ||
1083 | int frmx = -1; | ||
1084 | int ret,i; | 1083 | int ret,i; |
1085 | struct usbvision_frame *frame; | 1084 | struct usbvision_frame *frame; |
1086 | 1085 | ||
@@ -1155,7 +1154,7 @@ static ssize_t usbvision_v4l2_read(struct file *file, char *buf, | |||
1155 | frame->bytes_read = 0; | 1154 | frame->bytes_read = 0; |
1156 | 1155 | ||
1157 | /* Mark it as available to be used again. */ | 1156 | /* Mark it as available to be used again. */ |
1158 | usbvision->frame[frmx].grabstate = FrameState_Unused; | 1157 | frame->grabstate = FrameState_Unused; |
1159 | /* } */ | 1158 | /* } */ |
1160 | 1159 | ||
1161 | return count; | 1160 | return count; |