replace malloc with usb_malloc

This commit is contained in:
sakumisu
2022-04-15 16:49:54 +08:00
parent 97ddd9803a
commit 9708f51420

View File

@@ -415,7 +415,7 @@ void usbd_audio_add_entity(uint8_t entity_id, uint16_t bDescriptorSubtype)
control->automatic_gain[ch] = 0; control->automatic_gain[ch] = 0;
} }
#else #else
struct usbd_audio_attribute_control *control = malloc(sizeof(struct usbd_audio_attribute_control)); struct usbd_audio_attribute_control *control = usb_malloc(sizeof(struct usbd_audio_attribute_control));
memset(control, 0, sizeof(struct usbd_audio_attribute_control)); memset(control, 0, sizeof(struct usbd_audio_attribute_control));
for (uint8_t ch = 0; ch < CONFIG_USBDEV_AUDIO_MAX_CHANNEL; ch++) { for (uint8_t ch = 0; ch < CONFIG_USBDEV_AUDIO_MAX_CHANNEL; ch++) {
control->volume.wNumSubRanges = 1; control->volume.wNumSubRanges = 1;