You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/08/04 09:05:45 UTC
[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #10070: usb: fixed composite usbdev issue
pkarashchenko commented on code in PR #10070:
URL: https://github.com/apache/nuttx/pull/10070#discussion_r1284177901
##########
drivers/usbdev/adb.c:
##########
@@ -1625,10 +1628,28 @@ static void usbclass_uninitialize(FAR struct usbdevclass_driver_s *classdev)
classdev, FAR struct adb_driver_s, drvr);
#warning FIXME Maybe missing logic here
+ if (!alloc->dev.registered)
+ {
+ if (alloc->dev.crefs == 0)
+ {
+#ifdef CONFIG_USBADB_COMPOSITE
+ kmm_free(alloc);
+#endif
+ }
+
+ return;
+ }
unregister_driver(USBADB_CHARDEV_PATH);
- kmm_free(alloc);
+ if (alloc->dev.registered)
Review Comment:
Could be simplified to use `esle` and remove `return;` statements
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org