mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-08 07:35:04 +00:00
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 <oneukum@suse.com> CC: stable@vger.kernel.org Reported-by: Victor Sologoubov <victor0@rambler.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c289d0eff3
commit
7309aa847e
1 changed files with 2 additions and 0 deletions
|
@ -1161,6 +1161,8 @@ static int acm_probe(struct usb_interface *intf,
|
||||||
if (quirks == IGNORE_DEVICE)
|
if (quirks == IGNORE_DEVICE)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
memset(&h, 0x00, sizeof(struct usb_cdc_parsed_header));
|
||||||
|
|
||||||
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
|
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
|
||||||
|
|
||||||
/* handle quirks deadly to normal probing*/
|
/* handle quirks deadly to normal probing*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue