]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[usb] Leave port enabled after a failed device registration
authorMichael Brown <mcb30@ipxe.org>
Sat, 4 Jul 2020 10:52:26 +0000 (11:52 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sat, 4 Jul 2020 11:00:37 +0000 (12:00 +0100)
A failure in device registration (e.g. due to a device with malformed
descriptors) will currently result in the port being disabled as part
of the error path.  This in turn causes the hardware to detect the
device as newly connected, leading to an endless loop of failed device
registrations.

Fix by leaving the port enabled in the case of a registration failure.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/bus/usb.c

index d18751c667cadc477bb4947099a474a00ef1805c..a7b68752863c47c9e25e9b818c6dc6e099d4fb43 100644 (file)
@@ -1615,7 +1615,9 @@ static int register_usb ( struct usb_device *usb ) {
        usb->host->close ( usb );
  err_open:
  err_speed:
-       hub->driver->disable ( hub, port );
+       /* Leave port enabled on failure, to avoid an endless loop of
+        * failed device registrations.
+        */
  err_enable:
        list_del ( &usb->list );
        port->usb = NULL;