aboutsummaryrefslogtreecommitdiff
path: root/nuttx/drivers
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-04-25 16:47:28 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-04-25 16:47:28 +0000
commit5b83507116be57e0c84daea74d30dea382f20f97 (patch)
tree5ae0d3a4edccd428088dcf117a5241387c6d6f21 /nuttx/drivers
parentf544d4c1a8763e99e24c7a521c50c52458402475 (diff)
downloadpx4-firmware-5b83507116be57e0c84daea74d30dea382f20f97.tar.gz
px4-firmware-5b83507116be57e0c84daea74d30dea382f20f97.tar.bz2
px4-firmware-5b83507116be57e0c84daea74d30dea382f20f97.zip
Fix infinite loop in CDC/ACM driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4655 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/drivers')
-rw-r--r--nuttx/drivers/usbdev/cdcacm.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/nuttx/drivers/usbdev/cdcacm.c b/nuttx/drivers/usbdev/cdcacm.c
index 2065b5433..24903b504 100644
--- a/nuttx/drivers/usbdev/cdcacm.c
+++ b/nuttx/drivers/usbdev/cdcacm.c
@@ -2182,14 +2182,16 @@ void cdcacm_uninitialize(FAR void *handle)
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_UARTUNREGISTER), (uint16_t)-ret);
}
- /* Unbind the class (if still bound) */
-
- if (priv->usbdev)
- {
- cdcacm_unbind(&drvr->drvr, priv->usbdev);
- }
-
- /* Unregister the driver (unless we are a part of a composite device) */
+ /* Unregister the driver (unless we are a part of a composite device). The
+ * device unregister logic will (1) return all of the requests to us then
+ * (2) all the unbind method.
+ *
+ * The same thing will happen in the composite case except that: (1) the
+ * composite driver will call usbdev_unregister() which will (2) return the
+ * requests for all members of the composite, and (3) call the unbind
+ * method in the composite device which will (4) call the unbind method
+ * for this device.
+ */
#ifndef CONFIG_CDCACM_COMPOSITE
usbdev_unregister(&drvr->drvr);