Skip to contentSkip to conversation

staging: kpc2000: kpc_spi: Remove unnecessary null check before kfree

PATCH New YueHaibing 1 participant 1 message Jul 11, 2019 Staging

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 staging: kpc2000: kpc_spi: Remove unnecessary null check before kfree

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

---
 drivers/staging/kpc2000/kpc2000_spi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/kpc2000/kpc2000_spi.c +1 -2
index 35ac1d7..3be33c4 100644
@@ -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);
 }
 
 /******************
Signature · 1 line
2.7.4