xiaoxiang781216 commented on code in PR #9852:
URL: https://github.com/apache/nuttx/pull/9852#discussion_r1267448817


##########
drivers/usbhost/usbhost_hub.c:
##########
@@ -538,42 +539,51 @@ static inline int usbhost_hubdesc(FAR struct 
usbhost_class_s *hubclass)
   usbhost_putle16(ctrlreq->index, 0);
   usbhost_putle16(ctrlreq->len, USB_SIZEOF_HUBDESC);
 
+  ret = DRVR_ALLOC(hport->drvr, (FAR uint8_t **)&hubdesc, &maxlen);
+  if (ret < 0)
+    {
+      uerr("ERROR: DRVR_ALLOC failed: %d\n", ret);
+      return ret;
+    }
+
   ret = DRVR_CTRLIN(hport->drvr, hport->ep0,
-                    ctrlreq, (FAR uint8_t *)&hubdesc);
+                    ctrlreq, (FAR uint8_t *)hubdesc);
   if (ret < 0)
     {
       uerr("ERROR: Failed to read hub descriptor: %d\n", ret);

Review Comment:
   but you return at 554



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to