From 89b1a8ab25add376d10563320dc01c4843118596 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 12 May 2011 12:58:56 +0000 Subject: Fix USB host error handling logic git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3593 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/drivers/usbhost/usbhost_enumerate.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nuttx/drivers/usbhost/usbhost_enumerate.c') 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); } -- cgit v1.2.3