From 02799dbee223d00c403afddf675cedf81f1b8eab Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Thu, 20 Mar 2025 16:55:17 +0800 Subject: [PATCH] fix(i2s): add check for i2s DMA buffer array allocation Closes https://github.com/espressif/esp-idf/issues/15607 --- components/driver/i2s/i2s_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/driver/i2s/i2s_common.c b/components/driver/i2s/i2s_common.c index 4d7ccb7c17..e994b3e2fc 100644 --- a/components/driver/i2s/i2s_common.c +++ b/components/driver/i2s/i2s_common.c @@ -406,6 +406,7 @@ esp_err_t i2s_alloc_dma_desc(i2s_chan_handle_t handle, uint32_t num, uint32_t bu handle->dma.desc = (lldesc_t **)heap_caps_calloc(num, sizeof(lldesc_t *), I2S_MEM_ALLOC_CAPS); ESP_GOTO_ON_FALSE(handle->dma.desc, ESP_ERR_NO_MEM, err, TAG, "create I2S DMA decriptor array failed"); handle->dma.bufs = (uint8_t **)heap_caps_calloc(num, sizeof(uint8_t *), I2S_MEM_ALLOC_CAPS); + ESP_GOTO_ON_FALSE(handle->dma.bufs, ESP_ERR_NO_MEM, err, TAG, "create I2S DMA buffer array failed"); for (int i = 0; i < num; i++) { /* Allocate DMA descriptor */ handle->dma.desc[i] = (lldesc_t *) heap_caps_calloc(1, sizeof(lldesc_t), I2S_DMA_ALLOC_CAPS);