mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
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.
This commit is contained in:
@@ -1095,10 +1095,6 @@ static void usbhost_disconnect_event(FAR void *arg)
|
|||||||
|
|
||||||
work_cancel(LPWORK, &priv->work);
|
work_cancel(LPWORK, &priv->work);
|
||||||
|
|
||||||
/* Disable power to all downstream ports */
|
|
||||||
|
|
||||||
usbhost_hubpwr(priv, hport, false);
|
|
||||||
|
|
||||||
/* Free the allocated control request */
|
/* Free the allocated control request */
|
||||||
|
|
||||||
DRVR_FREE(hport->drvr, (FAR uint8_t *)priv->ctrlreq);
|
DRVR_FREE(hport->drvr, (FAR uint8_t *)priv->ctrlreq);
|
||||||
|
|||||||
Reference in New Issue
Block a user