diff options
| author | Oliver Neukum <[email protected]> | 2016-11-02 13:42:52 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2016-11-07 09:15:22 +0000 |
| commit | 7309aa847ead3fa561663b16779a0dde8c64cc7c (patch) | |
| tree | baeaaec22975af8624363b49e9ee4881277313cc /drivers/usb/class/cdc-acm.c | |
| parent | drivers/usb: Skip auto handoff for TI and RENESAS usb controllers (diff) | |
| download | kernel-7309aa847ead3fa561663b16779a0dde8c64cc7c.tar.gz kernel-7309aa847ead3fa561663b16779a0dde8c64cc7c.zip | |
cdc-acm: fix uninitialized variable
variable struct usb_cdc_parsed_header h may be used
uninitialized in acm_probe.
In kernel 4.8.
/* handle quirks deadly to normal probing*/
if (quirks == NO_UNION_NORMAL)
...
goto skip_normal_probe;
}
we bypass call to
cdc_parse_cdc_header(&h, intf, buffer, buflen);
but later use h in
if (h.usb_cdc_country_functional_desc) { /* export the country data */
Signed-off-by: Oliver Neukum <[email protected]>
CC: [email protected]
Reported-by: Victor Sologoubov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
| -rw-r--r-- | drivers/usb/class/cdc-acm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 78f0f85bebdc..4ad4ca44058b 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c @@ -1161,6 +1161,8 @@ static int acm_probe(struct usb_interface *intf, if (quirks == IGNORE_DEVICE) return -ENODEV; + memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header)); + num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR; /* handle quirks deadly to normal probing*/ |
