From 7842a746f8ca13b4657460d57fad334330ecea4c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 2 May 2015 11:38:27 -0600 Subject: [PATCH] USB host: If the implementation of the disconnect method frees the EP0 endpoint, then it must nullify it in the port structure --- arch/arm/src/sama5/sam_ohci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/sama5/sam_ohci.c b/arch/arm/src/sama5/sam_ohci.c index 83f2d1dafa..971a398acc 100644 --- a/arch/arm/src/sama5/sam_ohci.c +++ b/arch/arm/src/sama5/sam_ohci.c @@ -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; }