spi: fixed to invalid NULL check when tx_buf allocates. 72/154472/3
authorSegwon <segwon.han@samsung.com>
Tue, 10 Oct 2017 08:53:32 +0000 (17:53 +0900)
committerSegwon Han <segwon.han@samsung.com>
Tue, 10 Oct 2017 12:14:46 +0000 (12:14 +0000)
Change-Id: Ieb4e22cf35d685895960b26d25cd803bc702d67a
Signed-off-by: Segwon <segwon.han@samsung.com>
src/daemon/peripheral_bus_spi.c

index b66da6f..903b488 100644 (file)
@@ -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;