We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3679dfa commit 10e0f28Copy full SHA for 10e0f28
components/drivers/usb/usbdevice/class/cdc_vcom.c
@@ -493,6 +493,7 @@ static rt_err_t _function_enable(ufunction_t func)
493
494
data = (struct vcom*)func->user_data;
495
data->ep_out->buffer = rt_malloc(CDC_RX_BUFSIZE);
496
+ RT_ASSERT(data->ep_out->buffer != RT_NULL);
497
498
data->ep_out->request.buffer = data->ep_out->buffer;
499
data->ep_out->request.size = EP_MAXPACKET(data->ep_out);
@@ -593,6 +594,7 @@ ufunction_t rt_usbd_function_cdc_create(udevice_t device)
593
594
595
/* allocate memory for cdc vcom data */
596
data = (struct vcom*)rt_malloc(sizeof(struct vcom));
597
+ RT_ASSERT(data != RT_NULL);
598
rt_memset(data, 0, sizeof(struct vcom));
599
func->user_data = (void*)data;
600
0 commit comments