[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20171112083429.GA21682@embeddedor.com>
Date: Sun, 12 Nov 2017 02:34:29 -0600
From: "Gustavo A. R. Silva" <garsilva@...eddedor.com>
To: Hannes Reinecke <hare@...e.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
"Gustavo A. R. Silva" <garsilva@...eddedor.com>
Subject: [PATCH] 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.
Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
---
drivers/scsi/aic7xxx/aic7xxx_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 6612ff3..8d96e11 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -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
--
2.7.4
Powered by blists - more mailing lists