break;
}
- hub->children[port] = dev;
dev->state = USB_STATE_POWERED;
/* Reset the device, and detect its speed */
dev->dev.parent = dev->parent->dev.parent->parent;
/* Run it through the hoops (find a driver, etc) */
- if (!usb_new_device(dev, &hub->dev))
+ if (!usb_new_device(dev, &hub->dev)) {
+ hub->children[port] = dev;
goto done;
+ }
/* Free the configuration if there was an error */
usb_put_dev(dev);
delay = HUB_LONG_RESET_TIME;
}
- hub->children[port] = NULL;
hub_port_disable(hub, port);
done:
up(&usb_address0_sem);