From 172896728f6dce6109538fb61951b7480c560514 Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Mon, 12 Oct 2020 15:41:47 +0100 Subject: [PATCH] arch/xtensa/src/esp32/esp32_spi.c: Instead of returning with no error code, assert the return of the imm_malloc function. Signed-off-by: Abdelatif Guettouche --- arch/xtensa/src/esp32/esp32_spi.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/xtensa/src/esp32/esp32_spi.c b/arch/xtensa/src/esp32/esp32_spi.c index 9f2ec1793f..30498a5327 100644 --- a/arch/xtensa/src/esp32/esp32_spi.c +++ b/arch/xtensa/src/esp32/esp32_spi.c @@ -877,10 +877,7 @@ static void esp32_spi_dma_exchange(FAR struct esp32_spi_priv_s *priv, if (esp32_ptr_extram(txbuffer)) { tp = up_imm_malloc(bytes); - if (tp == NULL) - { - return; - } + DEBUGASSERT(tp != NULL); } else #endif @@ -892,10 +889,7 @@ static void esp32_spi_dma_exchange(FAR struct esp32_spi_priv_s *priv, if (esp32_ptr_extram(rxbuffer)) { rp = up_imm_malloc(bytes); - if (rp == NULL) - { - goto error_with_tp; - } + DEBUGASSERT(rp != NULL); } else #endif @@ -971,7 +965,6 @@ static void esp32_spi_dma_exchange(FAR struct esp32_spi_priv_s *priv, #endif #ifdef CONFIG_XTENSA_USE_SEPERATE_IMEM -error_with_tp: if (esp32_ptr_extram(txbuffer)) { up_imm_free(tp);