summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorAbdul Hussain <habdul@visteon.com>2015-06-18 12:37:00 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-18 20:20:57 -0700
commit0256b5406e3a87a776df9dd262a7dace0f49e7b0 (patch)
treec019edcde87dc94e4ccc4bc7ff5cf41e532bacdb /drivers/staging
parent61500fbd77eee4a27c59e3c930f03f5191db9da1 (diff)
downloadop-kernel-dev-0256b5406e3a87a776df9dd262a7dace0f49e7b0.zip
op-kernel-dev-0256b5406e3a87a776df9dd262a7dace0f49e7b0.tar.gz
Staging: wilc1000: NULL check before some freeing functions is not needed
This patch removes check before freeing the memory since kfree(NULL) is safe Signed-off-by: Abdul Hussain <habdul@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/wilc1000/linux_wlan_spi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan_spi.c b/drivers/staging/wilc1000/linux_wlan_spi.c
index 1eee1d5..236669c 100644
--- a/drivers/staging/wilc1000/linux_wlan_spi.c
+++ b/drivers/staging/wilc1000/linux_wlan_spi.c
@@ -214,8 +214,7 @@ int linux_spi_write(uint8_t *b, uint32_t len)
PRINT_ER("SPI transaction failed\n");
}
}
- if (r_buffer)
- kfree(r_buffer);
+ kfree(r_buffer);
} else {
PRINT_ER("can't write data with the following length: %d\n", len);
PRINT_ER("FAILED due to NULL buffer or ZERO length check the following length: %d\n", len);
@@ -377,8 +376,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
}
}
- if (t_buffer)
- kfree(t_buffer);
+ kfree(t_buffer);
} else {
PRINT_ER("can't read data with the following length: %ld\n", rlen);
ret = -1;
OpenPOWER on IntegriCloud