diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 5480352f984dc2df418902a430979c828cb5df52..781546269d269e4b8d60ee8117d1db4d173517d3 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1317,6 +1317,10 @@ static int hub_configure(struct usb_hub *hub, message = "hub has too many ports!"; ret = -ENODEV; goto fail; + } else if (hub->descriptor->bNbrPorts == 0) { + message = "hub doesn't have any ports!"; + ret = -ENODEV; + goto fail; } hdev->maxchild = hub->descriptor->bNbrPorts;