diff options
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, | |||
| 643 | 643 | ||
| 644 | } else if (header->bDescriptorType == | 644 | } else if (header->bDescriptorType == |
| 645 | USB_DT_INTERFACE_ASSOCIATION) { | 645 | USB_DT_INTERFACE_ASSOCIATION) { |
| 646 | struct usb_interface_assoc_descriptor *d; | ||
| 647 | |||
| 648 | d = (struct usb_interface_assoc_descriptor *)header; | ||
| 649 | if (d->bLength < USB_DT_INTERFACE_ASSOCIATION_SIZE) { | ||
| 650 | dev_warn(ddev, | ||
| 651 | "config %d has an invalid interface association descriptor of length %d, skipping\n", | ||
| 652 | cfgno, d->bLength); | ||
| 653 | continue; | ||
| 654 | } | ||
| 655 | |||
| 646 | if (iad_num == USB_MAXIADS) { | 656 | if (iad_num == USB_MAXIADS) { |
| 647 | dev_warn(ddev, "found more Interface " | 657 | dev_warn(ddev, "found more Interface " |
| 648 | "Association Descriptors " | 658 | "Association Descriptors " |
| 649 | "than allocated for in " | 659 | "than allocated for in " |
| 650 | "configuration %d\n", cfgno); | 660 | "configuration %d\n", cfgno); |
| 651 | } else { | 661 | } else { |
| 652 | config->intf_assoc[iad_num] = | 662 | config->intf_assoc[iad_num] = d; |
| 653 | (struct usb_interface_assoc_descriptor | ||
| 654 | *)header; | ||
| 655 | iad_num++; | 663 | iad_num++; |
| 656 | } | 664 | } |
| 657 | 665 | ||
| @@ -852,7 +860,7 @@ int usb_get_configuration(struct usb_device *dev) | |||
| 852 | } | 860 | } |
| 853 | 861 | ||
| 854 | if (dev->quirks & USB_QUIRK_DELAY_INIT) | 862 | if (dev->quirks & USB_QUIRK_DELAY_INIT) |
| 855 | msleep(100); | 863 | msleep(200); |
| 856 | 864 | ||
| 857 | result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, | 865 | result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, |
| 858 | bigbuffer, length); | 866 | bigbuffer, length); |
