Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22083
b: refs/heads/master
c: 6aa3567
h: refs/heads/master
i:
  22081: 850dd9c
  22079: 7df66fb
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 64b3cef commit 2343e06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11a223ae3b86b94391774512e5671600367a305c
refs/heads/master: 6aa35675bbc370e5f11baae7e01a9ab255d8030c
16 changes: 10 additions & 6 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,11 @@ static int choose_configuration(struct usb_device *udev)
c = udev->config;
num_configs = udev->descriptor.bNumConfigurations;
for (i = 0; i < num_configs; (i++, c++)) {
struct usb_interface_descriptor *desc =
&c->intf_cache[0]->altsetting->desc;
struct usb_interface_descriptor *desc = NULL;

/* It's possible that a config has no interfaces! */
if (c->desc.bNumInterfaces > 0)
desc = &c->intf_cache[0]->altsetting->desc;

/*
* HP's USB bus-powered keyboard has only one configuration
Expand Down Expand Up @@ -1215,7 +1218,8 @@ static int choose_configuration(struct usb_device *udev)
/* If the first config's first interface is COMM/2/0xff
* (MSFT RNDIS), rule it out unless Linux has host-side
* RNDIS support. */
if (i == 0 && desc->bInterfaceClass == USB_CLASS_COMM
if (i == 0 && desc
&& desc->bInterfaceClass == USB_CLASS_COMM
&& desc->bInterfaceSubClass == 2
&& desc->bInterfaceProtocol == 0xff) {
#ifndef CONFIG_USB_NET_RNDIS
Expand All @@ -1231,8 +1235,8 @@ static int choose_configuration(struct usb_device *udev)
* than a vendor-specific driver. */
else if (udev->descriptor.bDeviceClass !=
USB_CLASS_VENDOR_SPEC &&
desc->bInterfaceClass !=
USB_CLASS_VENDOR_SPEC) {
(!desc || desc->bInterfaceClass !=
USB_CLASS_VENDOR_SPEC)) {
best = c;
break;
}
Expand Down Expand Up @@ -3024,7 +3028,7 @@ int usb_reset_device(struct usb_device *udev)
parent_hub = hdev_to_hub(parent_hdev);

/* If we're resetting an active hub, take some special actions */
if (udev->actconfig &&
if (udev->actconfig && udev->actconfig->desc.bNumInterfaces > 0 &&
udev->actconfig->interface[0]->dev.driver ==
&hub_driver.driver &&
(hub = hdev_to_hub(udev)) != NULL) {
Expand Down

0 comments on commit 2343e06

Please sign in to comment.