This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 9948b5e701 usbhost: Make unplugging hubs more reliable.
9948b5e701 is described below
commit 9948b5e70114be4b04336d86b045109723c733bf
Author: Lwazi Dube <[email protected]>
AuthorDate: Mon May 15 22:24:34 2023 -0400
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);