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:
patacongo
2011-07-26 17:27:57 +00:00
parent f41d4fb0e3
commit fc7db01820
4 changed files with 27 additions and 35 deletions
+9 -8
View File
@@ -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);
}
}