diff options
author | Ingo Molnar | 2017-10-14 10:11:45 +0200 |
---|---|---|
committer | Ingo Molnar | 2017-10-14 10:11:45 +0200 |
commit | 6edcf57233108df2e50ab5d3fa695ea958b4c779 (patch) | |
tree | 7f233132de3cf1d438ac5ca51cfa6e9c48f8b86f /drivers/usb/core/config.c | |
parent | x86/unwinder: Make CONFIG_UNWINDER_ORC=y the default in the 64-bit defconfig (diff) | |
parent | objtool: Upgrade libelf-devel warning to error for CONFIG_ORC_UNWINDER (diff) | |
download | kernel-qcow2-linux-6edcf57233108df2e50ab5d3fa695ea958b4c779.tar.gz kernel-qcow2-linux-6edcf57233108df2e50ab5d3fa695ea958b4c779.tar.xz kernel-qcow2-linux-6edcf57233108df2e50ab5d3fa695ea958b4c779.zip |
Merge branch 'core/urgent' into x86/asm, to pick up dependency
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/usb/core/config.c')
-rw-r--r-- | drivers/usb/core/config.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 4be52c602e9b..68b54bd88d1e 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -643,15 +643,23 @@ static int usb_parse_configuration(struct usb_device *dev, int cfgidx, } else if (header->bDescriptorType == USB_DT_INTERFACE_ASSOCIATION) { + struct usb_interface_assoc_descriptor *d; + + d = (struct usb_interface_assoc_descriptor *)header; + if (d->bLength < USB_DT_INTERFACE_ASSOCIATION_SIZE) { + dev_warn(ddev, + "config %d has an invalid interface association descriptor of length %d, skipping\n", + cfgno, d->bLength); + continue; + } + if (iad_num == USB_MAXIADS) { dev_warn(ddev, "found more Interface " "Association Descriptors " "than allocated for in " "configuration %d\n", cfgno); } else { - config->intf_assoc[iad_num] = - (struct usb_interface_assoc_descriptor - *)header; + config->intf_assoc[iad_num] = d; iad_num++; } @@ -852,7 +860,7 @@ int usb_get_configuration(struct usb_device *dev) } if (dev->quirks & USB_QUIRK_DELAY_INIT) - msleep(100); + msleep(200); result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, bigbuffer, length); |