AMA5 OHCI: Pointers to allocated port values were not being nullified after being deallocated. This caused some assertions when debug was enabled

This commit is contained in:
Gregory Nutt 2014-07-04 08:17:14 -06:00
parent 1211bbd904
commit 77439f3c75

View File

@ -1394,7 +1394,7 @@ static int sam_ep0enqueue(struct sam_rhport_s *rhport)
tdtail = sam_tdalloc(); tdtail = sam_tdalloc();
if (!tdtail) if (!tdtail)
{ {
sam_edfree(rhport->ep0.ed); sam_edfree(edctrl);
irqrestore(flags); irqrestore(flags);
return -ENOMEM; return -ENOMEM;
} }
@ -1466,7 +1466,7 @@ static int sam_ep0enqueue(struct sam_rhport_s *rhport)
* Name: sam_ep0dequeue * Name: sam_ep0dequeue
* *
* Description: * Description:
* Remove the ED for EP0 from the control ED list and posssibly disable control * Remove the ED for EP0 from the control ED list and possibly disable control
* list processing. * list processing.
* *
* Input Parameters: * Input Parameters:
@ -1548,6 +1548,7 @@ static void sam_ep0dequeue(struct sam_rhport_s *rhport)
sam_putreg(regval, SAM_USBHOST_CTRL); sam_putreg(regval, SAM_USBHOST_CTRL);
} }
} }
irqrestore(flags); irqrestore(flags);
/* Release any TDs that may still be attached to the ED. */ /* Release any TDs that may still be attached to the ED. */
@ -1567,6 +1568,9 @@ static void sam_ep0dequeue(struct sam_rhport_s *rhport)
sam_tdfree(tdtail); sam_tdfree(tdtail);
sam_edfree(edctrl); sam_edfree(edctrl);
rhport->ep0.ed = NULL;
rhport->ep0.tail = NULL;
} }
/******************************************************************************* /*******************************************************************************