diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2013-02-07 05:05:43 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-08 14:30:53 -0500 |
commit | 82f0efbcd3c4e6bf7cdfeed5c901b812e6d30f92 (patch) | |
tree | f34422ddad3328fd8dc8f8c1827841c4e5817623 /drivers/media | |
parent | bf5bbed15c41228ea1abbb8d3931050922bfc37f (diff) |
[media] tm6000: fix an uninitialized variable
tm6000_poll could use an uninitialized buf pointer. Move the buf-handling
code inside the 'if' that initializes the buf pointer.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-video.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index eab23413a909..1a6857929c15 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c | |||
@@ -1455,14 +1455,14 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait) | |||
1455 | if (list_empty(&fh->vb_vidq.stream)) | 1455 | if (list_empty(&fh->vb_vidq.stream)) |
1456 | return res | POLLERR; | 1456 | return res | POLLERR; |
1457 | buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); | 1457 | buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); |
1458 | poll_wait(file, &buf->vb.done, wait); | ||
1459 | if (buf->vb.state == VIDEOBUF_DONE || | ||
1460 | buf->vb.state == VIDEOBUF_ERROR) | ||
1461 | return res | POLLIN | POLLRDNORM; | ||
1458 | } else if (req_events & (POLLIN | POLLRDNORM)) { | 1462 | } else if (req_events & (POLLIN | POLLRDNORM)) { |
1459 | /* read() capture */ | 1463 | /* read() capture */ |
1460 | return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); | 1464 | return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); |
1461 | } | 1465 | } |
1462 | poll_wait(file, &buf->vb.done, wait); | ||
1463 | if (buf->vb.state == VIDEOBUF_DONE || | ||
1464 | buf->vb.state == VIDEOBUF_ERROR) | ||
1465 | return res | POLLIN | POLLRDNORM; | ||
1466 | return res; | 1466 | return res; |
1467 | } | 1467 | } |
1468 | 1468 | ||