From c9e398d3e50c107393f017c4374104b75d7fc608 Mon Sep 17 00:00:00 2001 From: Segwon Date: Tue, 10 Oct 2017 17:53:32 +0900 Subject: [PATCH] spi: fixed to invalid NULL check when tx_buf allocates. Change-Id: Ieb4e22cf35d685895960b26d25cd803bc702d67a Signed-off-by: Segwon --- src/daemon/peripheral_bus_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon/peripheral_bus_spi.c b/src/daemon/peripheral_bus_spi.c index b66da6f..903b488 100644 --- a/src/daemon/peripheral_bus_spi.c +++ b/src/daemon/peripheral_bus_spi.c @@ -98,7 +98,7 @@ int peripheral_bus_spi_open(int bus, int cs, pb_data_h *handle, gpointer user_da goto err_rx_buf; } spi_handle->dev.spi.tx_buf = (uint8_t*)calloc(1, initial_buffer_size); - if (!spi_handle->dev.spi.rx_buf) { + if (!spi_handle->dev.spi.tx_buf) { _E("Failed to allocate tx buffer"); ret = PERIPHERAL_ERROR_OUT_OF_MEMORY; goto err_tx_buf; -- 2.7.4