Merged in ziggurat29/nuttx (pull request #86)

cdcacm_unbind leaks write request objects.  This arises due to freeing the
This commit is contained in:
Gregory Nutt
2016-07-07 11:22:16 -06:00
+8 -8
View File
@@ -1162,14 +1162,6 @@ static void cdcacm_unbind(FAR struct usbdevclass_driver_s *driver,
priv->epintin = NULL;
}
/* Free the bulk IN endpoint */
if (priv->epbulkin)
{
DEV_FREEEP(dev, priv->epbulkin);
priv->epbulkin = NULL;
}
/* Free the pre-allocated control request */
if (priv->ctrlreq != NULL)
@@ -1220,6 +1212,14 @@ static void cdcacm_unbind(FAR struct usbdevclass_driver_s *driver,
DEBUGASSERT(priv->nwrq == 0);
leave_critical_section(flags);
/* Free the bulk IN endpoint */
if (priv->epbulkin)
{
DEV_FREEEP(dev, priv->epbulkin);
priv->epbulkin = NULL;
}
/* Clear out all data in the circular buffer */
priv->serdev.xmit.head = 0;