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 -2
View File
@@ -3622,9 +3622,15 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
}
#endif
/* Unbind the class driver */
/* Reset the hardware and cancel all requests. All requests must be
* canceled while the class driver is still bound.
*/
flags = irqsave();
stm32_reset(priv);
/* Unbind the class driver */
CLASS_UNBIND(driver, &priv->usbdev);
/* Disable USB controller interrupts (but keep them attached) */
@@ -3633,7 +3639,8 @@ int usbdev_unregister(struct usbdevclass_driver_s *driver)
up_disable_irq(STM32_IRQ_USBLPCANRX0);
/* Put the hardware in an inactive state. Then bring the hardware back up
* in the reset state.
* in the reset state (this is probably not necessary, the stm32_reset()
* call above was probably sufficient).
*/
stm32_hwshutdown(priv);