X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Fcore%2Fhub.c;h=207c33d369bee80f0d88b302dbb00475defe7194;hb=625f694936cbbdee98e6cc65f72724a7660e7946;hp=e678ed8bd8c237be56181d01a8fc6935259e2bb9;hpb=4330354f7660828d97834598633054b413f6264d;p=linux-2.6 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e678ed8bd8..207c33d369 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1051,6 +1051,12 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) desc = intf->cur_altsetting; hdev = interface_to_usbdev(intf); + if (hdev->level == MAX_TOPO_LEVEL) { + dev_err(&intf->dev, "Unsupported bus topology: " + "hub nested too deep\n"); + return -E2BIG; + } + #ifdef CONFIG_USB_OTG_BLACKLIST_HUB if (hdev->parent) { dev_warn(&intf->dev, "ignoring external hub\n"); @@ -2706,7 +2712,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, #endif } else { - status = usb_reset_composite_device(udev, NULL); + status = usb_reset_composite_device(udev); } usb_unlock_device(udev); @@ -2934,7 +2940,7 @@ static void hub_events(void) dev_dbg (hub_dev, "resetting for error %d\n", hub->error); - ret = usb_reset_composite_device(hdev, intf); + ret = usb_reset_composite_device(hdev); if (ret) { dev_dbg (hub_dev, "error resetting hub: %d\n", ret); @@ -3349,7 +3355,6 @@ EXPORT_SYMBOL_GPL(usb_reset_device); /** * usb_reset_composite_device - warn interface drivers and perform a USB port reset * @udev: device to reset (not in SUSPENDED or NOTATTACHED state) - * @iface: interface bound to the driver making the request (optional) * * Warns all drivers bound to registered interfaces (using their pre_reset * method), performs the port reset, and then lets the drivers know that @@ -3362,8 +3367,7 @@ EXPORT_SYMBOL_GPL(usb_reset_device); * For calls that might not occur during probe(), drivers should lock * the device using usb_lock_device_for_reset(). */ -int usb_reset_composite_device(struct usb_device *udev, - struct usb_interface *iface) +int usb_reset_composite_device(struct usb_device *udev) { int ret; int i; @@ -3379,9 +3383,6 @@ int usb_reset_composite_device(struct usb_device *udev, /* Prevent autosuspend during the reset */ usb_autoresume_device(udev); - if (iface && iface->condition != USB_INTERFACE_BINDING) - iface = NULL; - if (config) { for (i = 0; i < config->desc.bNumInterfaces; ++i) { struct usb_interface *cintf = config->interface[i];