mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Merged in ziggurat29/nuttx (pull request #86)
cdcacm_unbind leaks write request objects. This arises due to freeing the
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user