]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/core/hub.c
usb: hub: add check for unsupported bus topology
[linux-2.6-omap-h63xx.git] / drivers / usb / core / hub.c
index e678ed8bd8c237be56181d01a8fc6935259e2bb9..3251120b414e135285110d3b890c266a06d8ff54 100644 (file)
@@ -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");