summaryrefslogtreecommitdiff
path: root/nuttx/drivers/usbhost/usbhost_enumerate.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-12 12:58:56 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-05-12 12:58:56 +0000
commit89b1a8ab25add376d10563320dc01c4843118596 (patch)
tree6635001e24e49d9944fe3db24265843737b450b9 /nuttx/drivers/usbhost/usbhost_enumerate.c
parent7596c8e003e4bbe8722cce117d283d6209257445 (diff)
downloadnuttx-89b1a8ab25add376d10563320dc01c4843118596.tar.gz
nuttx-89b1a8ab25add376d10563320dc01c4843118596.tar.bz2
nuttx-89b1a8ab25add376d10563320dc01c4843118596.zip
Fix USB host error handling logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3593 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/usbhost/usbhost_enumerate.c')
-rwxr-xr-xnuttx/drivers/usbhost/usbhost_enumerate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nuttx/drivers/usbhost/usbhost_enumerate.c b/nuttx/drivers/usbhost/usbhost_enumerate.c
index 1c3a827bf..8e1cd80e7 100755
--- a/nuttx/drivers/usbhost/usbhost_enumerate.c
+++ b/nuttx/drivers/usbhost/usbhost_enumerate.c
@@ -249,6 +249,10 @@ static inline int usbhost_classbind(FAR struct usbhost_driver_s *drvr,
ret = CLASS_CONNECT(devclass, configdesc, desclen, funcaddr);
if (ret != OK)
{
+ /* On failures, call the class disconnect method which
+ * should then free the allocated devclass instance.
+ */
+
udbg("CLASS_CONNECT failed: %d\n", ret);
CLASS_DISCONNECTED(devclass);
}