USB host: If the implementation of the disconnect method frees the EP0 endpoint, then it must nullify it in the port structure

This commit is contained in:
Gregory Nutt 2015-05-02 11:38:27 -06:00
parent 823af4b409
commit 80d4c7c21a

View File

@ -2781,7 +2781,8 @@ static int sam_epfree(struct usbhost_driver_s *drvr, usbhost_ep_t ep)
struct sam_ed_s *ed;
int ret;
DEBUGASSERT(rhport && eplist && eplist->ed && eplist->tail);
DEBUGASSERT(rhport != NULL && eplist != NULL &&
eplist->ed != NULL && eplist->tail != NULL);
/* There should not be any pending, real TDs linked to this ED */
@ -3694,6 +3695,7 @@ static void sam_disconnect(struct usbhost_driver_s *drvr,
/* Unbind the class from the port */
hport->ep0 = NULL;
hport->devclass = NULL;
}