aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-07-04 11:52:26 +0100
committerMichael Brown <mcb30@ipxe.org>2020-07-04 12:00:37 +0100
commit586b723733904c0825844582dd19a44c71bc972b (patch)
treeb2282f1fc886435ce224b25cf76455263f88989c
parentf727ed8a112355c964b25a472e6da361864ee574 (diff)
downloadipxe-586b723733904c0825844582dd19a44c71bc972b.zip
ipxe-586b723733904c0825844582dd19a44c71bc972b.tar.gz
ipxe-586b723733904c0825844582dd19a44c71bc972b.tar.bz2
[usb] Leave port enabled after a failed device registration
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>
-rw-r--r--src/drivers/bus/usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/bus/usb.c b/src/drivers/bus/usb.c
index d18751c..a7b6875 100644
--- a/src/drivers/bus/usb.c
+++ b/src/drivers/bus/usb.c
@@ -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;