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:
parent
150680d677
commit
9948b5e701
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user