Просмотр исходного кода

replace malloc with usb_malloc

sakumisu 3 лет назад
Родитель
Сommit
9708f51420
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      class/audio/usbd_audio.c

+ 1 - 1
class/audio/usbd_audio.c

@@ -415,7 +415,7 @@ void usbd_audio_add_entity(uint8_t entity_id, uint16_t bDescriptorSubtype)
             control->automatic_gain[ch] = 0;
         }
 #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));
         for (uint8_t ch = 0; ch < CONFIG_USBDEV_AUDIO_MAX_CHANNEL; ch++) {
             control->volume.wNumSubRanges = 1;