Skip to contentSkip to conversation

staging: kpc2000: Remove null check before kfree

PATCH New Hariprasad Kelam 1 participant 1 message Jul 18, 2019 Staging

lore
Share & tools
lore
#0 lore raw

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

As kfree already has NULL check we may not need null check before calling same.

Issue found with coccicheck

---
 drivers/staging/kpc2000/kpc2000_spi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/kpc2000/kpc2000_spi.c +1 -3
index 35ac1d7..c07d2fc 100644
@@ -411,9 +411,7 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m)
 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