drivers: spi: spi_esp32_spim: Remove check for NULL before freeing

As per k_free() documentation it accepts a NULL argument.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
Andriy Gelman 2023-03-12 16:32:52 -04:00 committed by Carles Cufí
parent 1eff8e76bd
commit 6c3998d494

View file

@ -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;
}