summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--payloads/libpayload/drivers/usb/usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c
index eb23760033..25bd954ded 100644
--- a/payloads/libpayload/drivers/usb/usb.c
+++ b/payloads/libpayload/drivers/usb/usb.c
@@ -636,4 +636,9 @@ usb_generic_init (usbdev_t *dev)
if (usb_generic_create)
usb_generic_create(dev);
+
+ if (dev->data == NULL) {
+ usb_debug("Detaching device not used by payload\n");
+ usb_detach_device(dev->controller, dev->address);
+ }
}