mirror of
https://github.com/torvalds/linux.git
synced 2024-12-20 01:52:13 +00:00
[media] tm6000: fix vbuf may be used uninitialized
In commit8aff8ba951
, 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 to8aff8ba951
. 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>
This commit is contained in:
parent
990528ebe7
commit
cc73b4b57c
@ -228,7 +228,7 @@ static int copy_streams(u8 *data, unsigned long len,
|
||||
unsigned long header = 0;
|
||||
int rc = 0;
|
||||
unsigned int cmd, cpysize, pktsize, size, field, block, line, pos = 0;
|
||||
struct tm6000_buffer *vbuf;
|
||||
struct tm6000_buffer *vbuf = NULL;
|
||||
char *voutp = NULL;
|
||||
unsigned int linewidth;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user