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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]