diff options
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index a7515d165390..896532d3fc2d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1557,10 +1557,15 @@ static int hub_configure(struct usb_hub *hub, | |||
1557 | if (hub->has_indicators && blinkenlights) | 1557 | if (hub->has_indicators && blinkenlights) |
1558 | hub->indicator [0] = INDICATOR_CYCLE; | 1558 | hub->indicator [0] = INDICATOR_CYCLE; |
1559 | 1559 | ||
1560 | for (i = 0; i < hdev->maxchild; i++) | 1560 | for (i = 0; i < hdev->maxchild; i++) { |
1561 | if (usb_hub_create_port_device(hub, i + 1) < 0) | 1561 | ret = usb_hub_create_port_device(hub, i + 1); |
1562 | if (ret < 0) { | ||
1562 | dev_err(hub->intfdev, | 1563 | dev_err(hub->intfdev, |
1563 | "couldn't create port%d device.\n", i + 1); | 1564 | "couldn't create port%d device.\n", i + 1); |
1565 | hdev->maxchild = i; | ||
1566 | goto fail_keep_maxchild; | ||
1567 | } | ||
1568 | } | ||
1564 | 1569 | ||
1565 | usb_hub_adjust_deviceremovable(hdev, hub->descriptor); | 1570 | usb_hub_adjust_deviceremovable(hdev, hub->descriptor); |
1566 | 1571 | ||
@@ -1569,6 +1574,7 @@ static int hub_configure(struct usb_hub *hub, | |||
1569 | 1574 | ||
1570 | fail: | 1575 | fail: |
1571 | hdev->maxchild = 0; | 1576 | hdev->maxchild = 0; |
1577 | fail_keep_maxchild: | ||
1572 | dev_err (hub_dev, "config failed, %s (err %d)\n", | 1578 | dev_err (hub_dev, "config failed, %s (err %d)\n", |
1573 | message, ret); | 1579 | message, ret); |
1574 | /* hub_disconnect() frees urb and descriptor */ | 1580 | /* hub_disconnect() frees urb and descriptor */ |