diff options
author | Jarod Wilson <jarod@redhat.com> | 2011-04-11 17:49:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 08:27:42 -0400 |
commit | cc73b4b57c59141bb8a99f86a1af95f296262558 (patch) | |
tree | f555857795f0bccb967d974a1738dd7feef294a3 /drivers/staging | |
parent | 990528ebe7b7f07f67e29e66700297b10557a706 (diff) |
[media] tm6000: fix vbuf may be used uninitialized
In commit 8aff8ba95155df, most of the manipulations to vbuf inside
copy_streams were gated on if !dev->radio, but one place that touches
vbuf lays outside those gates -- a memcpy of vbuf isn't NULL. If we
initialize vbuf to NULL, that memcpy will never happen in the case where
we do have dev->radio, and otherwise, in the !dev->radio case, the code
behaves exactly like it did prior to 8aff8ba95155df.
While we're at it, also fix an incorrectly indented closing brace for
one of the sections touching vbuf that is conditional on !dev->radio.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/tm6000/tm6000-video.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index 17db6684abbe..f82edfaac522 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c | |||
@@ -228,7 +228,7 @@ static int copy_streams(u8 *data, unsigned long len, | |||
228 | unsigned long header = 0; | 228 | unsigned long header = 0; |
229 | int rc = 0; | 229 | int rc = 0; |
230 | unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0; | 230 | unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0; |
231 | struct tm6000_buffer *vbuf; | 231 | struct tm6000_buffer *vbuf = NULL; |
232 | char *voutp = NULL; | 232 | char *voutp = NULL; |
233 | unsigned int linewidth; | 233 | unsigned int linewidth; |
234 | 234 | ||
@@ -318,7 +318,7 @@ static int copy_streams(u8 *data, unsigned long len, | |||
318 | if (pos + size > vbuf->vb.size) | 318 | if (pos + size > vbuf->vb.size) |
319 | cmd = TM6000_URB_MSG_ERR; | 319 | cmd = TM6000_URB_MSG_ERR; |
320 | dev->isoc_ctl.vfield = field; | 320 | dev->isoc_ctl.vfield = field; |
321 | } | 321 | } |
322 | break; | 322 | break; |
323 | case TM6000_URB_MSG_VBI: | 323 | case TM6000_URB_MSG_VBI: |
324 | break; | 324 | break; |