- goto resetfail;
-
- // Set address of port
- struct usb_pipe *pipe = usb_set_address(
- hub->cntl, !!(sts.wPortStatus & USB_PORT_STAT_LOW_SPEED));
- if (!pipe)
- goto resetfail;
- mutex_unlock(&hub->cntl->resetlock);
-
- // Configure the device
- int count = configure_usb_device(pipe);
- free_pipe(pipe);
- if (!count) {
- ret = clear_port_feature(hub, port, USB_PORT_FEAT_ENABLE);
- if (ret)
- goto fail;
- }
- hub->devcount += count;
-done:
- hub->threads--;
- return;
-
-resetfail:
- clear_port_feature(hub, port, USB_PORT_FEAT_ENABLE);
- mutex_unlock(&hub->cntl->resetlock);