We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dd0d41 commit f36a1bbCopy full SHA for f36a1bb
components/drivers/usb/usbhost/core/hub.c
@@ -14,6 +14,11 @@
14
15
#define USB_THREAD_STACK_SIZE 4096
16
17
+#define DBG_TAG "usbhost.hub"
18
+#define DBG_LVL DBG_INFO
19
+#include <rtdbg.h>
20
+
21
22
// static struct rt_messagequeue *usb_mq;
23
static struct uclass_driver hub_driver;
24
// static struct uhub root_hub;
@@ -702,6 +707,11 @@ void rt_usbh_hub_init(uhcd_t hcd)
702
707
rt_thread_t thread;
703
708
/* create root hub for hcd */
704
709
hcd->roothub = rt_malloc(sizeof(struct uhub));
710
+ if(hcd->roothub == RT_NULL)
711
+ {
712
+ LOG_E("hcd->roothub: allocate buffer failed.");
713
+ return;
714
+ }
705
715
rt_memset(hcd->roothub, 0, sizeof(struct uhub));
706
716
hcd->roothub->is_roothub = RT_TRUE;
717
hcd->roothub->hcd = hcd;
0 commit comments