From 9948b5e70114be4b04336d86b045109723c733bf Mon Sep 17 00:00:00 2001 From: Lwazi Dube Date: Mon, 15 May 2023 22:24:34 -0400 Subject: [PATCH] usbhost: Make unplugging hubs more reliable. USB drivers should not try control devices in the usbhost_disconnected function. The control endpoint is NULL at this point because the device has already been disconnected. Before this change, the hub driver crashed when the child called usbhost_hubpwr after the parent had already deactivated the control pipe and set hport->ep0 to NULL. --- drivers/usbhost/usbhost_hub.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/usbhost/usbhost_hub.c b/drivers/usbhost/usbhost_hub.c index 3fcf039589..bbeb72a117 100644 --- a/drivers/usbhost/usbhost_hub.c +++ b/drivers/usbhost/usbhost_hub.c @@ -1095,10 +1095,6 @@ static void usbhost_disconnect_event(FAR void *arg) work_cancel(LPWORK, &priv->work); - /* Disable power to all downstream ports */ - - usbhost_hubpwr(priv, hport, false); - /* Free the allocated control request */ DRVR_FREE(hport->drvr, (FAR uint8_t *)priv->ctrlreq);