[PATCH -next] staging: kpc2000: kpc_spi: Remove unnecessary null check before kfree

From: YueHaibing
Date: Thu Jul 11 2019 - 10:07:58 EST


A null check before a kfree is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
---
drivers/staging/kpc2000/kpc2000_spi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index 35ac1d7..3be33c4 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -412,8 +412,7 @@ kp_spi_cleanup(struct spi_device *spidev)
{
struct kp_spi_controller_state *cs = spidev->controller_state;

- if (cs)
- kfree(cs);
+ kfree(cs);
}

/******************
--
2.7.4