[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] [PATCH][2/3] USB: Free root hub if error in initialization
Commit message:
If something goes wrong during root hub initialization,
we should free the allocated USB device.
Contributed by David Galvez.
diff -r 6c160c702aea -r 4e50c46a9eb0 sys/usb/src.km/ucd.c
--- a/sys/usb/src.km/ucd.c Sat Apr 04 13:38:38 2015 +0200
+++ b/sys/usb/src.km/ucd.c Sat Apr 04 13:42:52 2015 +0200
@@ -86,6 +86,8 @@
if (usb_new_device(hub))
{
+ /* Something went wrong, clear device */
+ usb_free_device(hub->devnum);
return -1;
}