diff --git a/drivers/spi/spi_esp32_spim.c b/drivers/spi/spi_esp32_spim.c index 878c021c0e..50e9ab58eb 100644 --- a/drivers/spi/spi_esp32_spim.c +++ b/drivers/spi/spi_esp32_spim.c @@ -133,13 +133,8 @@ static int IRAM_ATTR spi_esp32_transfer(const struct device *dev) spi_context_update_rx(&data->ctx, data->dfs, chunk_len); - if (tx_temp) { - k_free(tx_temp); - } - - if (rx_temp) { - k_free(rx_temp); - } + k_free(tx_temp); + k_free(rx_temp); return 0; }