Skip to contentSkip to conversation

scsi: aic7xxx_core: remove unnecessary null check before kfree

PATCH New Gustavo A. R. Silva 1 participant 1 message Nov 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: aic7xxx_core: remove unnecessary null check before kfree

NULL check before freeing functions like kfree is not needed.

This code was detected with the help of Coccinelle.

---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +2 -4
index 6612ff3..8d96e11 100644
@@ -4549,10 +4549,8 @@ ahc_free(struct ahc_softc *ahc)
 		kfree(ahc->black_hole);
 	}
 #endif
-	if (ahc->name != NULL)
-		kfree(ahc->name);
-	if (ahc->seep_config != NULL)
-		kfree(ahc->seep_config);
+	kfree(ahc->name);
+	kfree(ahc->seep_config);
 #ifndef __FreeBSD__
 	kfree(ahc);
 #endif
Signature · 1 line
2.7.4