aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-01-31 10:56:37 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-03 19:46:06 -0500
commitd199c96d41d80a567493e12b8e96ea056a1350c1 (patch)
treed3a5df8eca1476e6ba950b941a69de3becf6b75d /drivers/usb/core/hub.c
parent6d86d52a33cfe6338efd007cfcca895b18c1d84b (diff)
USB: prevent buggy hubs from crashing the USB stack
If anyone comes across a high-speed hub that (by mistake or by design) claims to have no Transaction Translators, plugging a full- or low-speed device into it will cause the USB stack to crash. This patch (as1446) prevents the problem by ignoring such devices, since the kernel has no way to communicate with them. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Perry Neben <neben@vmware.com> CC: <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 4310cc4b1cb5..d041c6826e43 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2753,6 +2753,11 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
2753 udev->ttport = hdev->ttport; 2753 udev->ttport = hdev->ttport;
2754 } else if (udev->speed != USB_SPEED_HIGH 2754 } else if (udev->speed != USB_SPEED_HIGH
2755 && hdev->speed == USB_SPEED_HIGH) { 2755 && hdev->speed == USB_SPEED_HIGH) {
2756 if (!hub->tt.hub) {
2757 dev_err(&udev->dev, "parent hub has no TT\n");
2758 retval = -EINVAL;
2759 goto fail;
2760 }
2756 udev->tt = &hub->tt; 2761 udev->tt = &hub->tt;
2757 udev->ttport = port1; 2762 udev->ttport = port1;
2758 } 2763 }