mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
Correct USB mass storage memory leak
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3820 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -670,14 +670,6 @@ static void usbstrg_unbind(FAR struct usbdev_s *dev)
|
||||
usbstrg_resetconfig(priv);
|
||||
up_mdelay(50);
|
||||
|
||||
/* 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)
|
||||
@@ -721,6 +713,15 @@ static void usbstrg_unbind(FAR struct usbdev_s *dev)
|
||||
usbstrg_freereq(priv->epbulkin, reqcontainer->req);
|
||||
}
|
||||
}
|
||||
|
||||
/* Free the bulk IN endpoint */
|
||||
|
||||
if (priv->epbulkin)
|
||||
{
|
||||
DEV_FREEEP(dev, priv->epbulkin);
|
||||
priv->epbulkin = NULL;
|
||||
}
|
||||
|
||||
irqrestore(flags);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user