summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authorDavid Lin <[email protected]>2020-03-21 20:42:55 +0800
committerGitHub <[email protected]>2020-03-21 20:42:55 +0800
commit3679dfa07eee22e4df5517a1c3b26e018e3bd971 (patch)
treee93183f7ede05c383b6e643e0df2605a9993e7b6 /components/drivers
parent30a9ef64c172c14480dd800cfee16b9572679846 (diff)
Update ecm.c
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/usb/usbdevice/class/ecm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/class/ecm.c b/components/drivers/usb/usbdevice/class/ecm.c
index cf948adbfc..36557dad74 100644
--- a/components/drivers/usb/usbdevice/class/ecm.c
+++ b/components/drivers/usb/usbdevice/class/ecm.c
@@ -565,7 +565,8 @@ ufunction_t rt_usbd_function_ecm_create(udevice_t device)
/* create a cdc class */
cdc = rt_usbd_function_new(device, &_dev_desc, &ops);
rt_usbd_device_set_qualifier(device, &dev_qualifier);
- _ecm_eth= rt_malloc(sizeof(struct rt_ecm_eth));
+ _ecm_eth= rt_malloc(sizeof(struct rt_ecm_eth));
+ RT_ASSERT(_ecm_eth != RT_NULL);
rt_memset(_ecm_eth, 0, sizeof(struct rt_ecm_eth));
cdc->user_data = _ecm_eth;