diff options
author | Felipe Balbi <felipe.balbi@nokia.com> | 2008-06-12 10:49:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 15:16:26 -0700 |
commit | 38f3ad5e7463d4dd490a8081a5f3f9f2dec7ecd6 (patch) | |
tree | 2dd60da46d065e4df9e34fe031d13e38bfc22dff /drivers/usb/core/hub.c | |
parent | 6deb270b5c60680ca9117bd545302ea6a58bad42 (diff) | |
download | op-kernel-dev-38f3ad5e7463d4dd490a8081a5f3f9f2dec7ecd6.zip op-kernel-dev-38f3ad5e7463d4dd490a8081a5f3f9f2dec7ecd6.tar.gz |
usb: hub: add check for unsupported bus topology
We can't allow hubs on the 7th tier as they would allow
devices on the 8th tier.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index e678ed8..3251120 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"); |