Skip to content

Commit

Permalink
[component/usb/webusb_hcd] clear devices memory after allocated
Browse files Browse the repository at this point in the history
  • Loading branch information
versaloon committed Aug 7, 2023
1 parent b2a82ff commit d6006b3
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ static int __vk_webusb_init(vk_webusb_hcd_t *hcd)
if (hcd->dev_num > 0) {
hcd->devs = (vk_webusb_hcd_dev_t *)vsf_usbh_malloc(sizeof(vk_webusb_hcd_dev_t) * hcd->dev_num);
VSF_USB_ASSERT(hcd->devs != NULL);
memset(hcd->devs, 0, sizeof(vk_webusb_hcd_dev_t) * hcd->dev_num);

for (int i = 0; i < hcd->dev_num; i++) {
vk_webusb_hcd_dev_t *webusb_dev = &hcd->devs[i];
Expand Down

0 comments on commit d6006b3

Please sign in to comment.