Skip to contentSkip to conversation

scsi: megaraid_sas: remove redundant NULL check

PATCH In review Yang Li 2 participants 2 messages Jan 22, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 scsi: megaraid_sas: remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/scsi/megaraid/megaraid_sas_fusion.c:3924:3-8: WARNING: NULL check before some freeing functions is not needed.

---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -2
index fd60728..38fc946 100644
@@ -3920,8 +3920,7 @@ static irqreturn_t megasas_isr_fusion(int irq, void *devp)
 {
 	unsigned int i;
 	for (i = 0; i < instance->drv_buf_alloc; i++) {
-		if (instance->crash_buf[i])
-			vfree(instance->crash_buf[i]);
+		vfree(instance->crash_buf[i]);
 	}
 	instance->drv_buf_index = 0;
 	instance->drv_buf_alloc = 0;
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 8 lines · Yang Li

Fix below warnings reported by coccicheck:
./drivers/scsi/megaraid/megaraid_sas_fusion.c:3924:3-8: WARNING: NULL check before some freeing functions is not needed.

---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 3 +--

Please always use scripts/get_maintainer.pl to determine who to send patches to, and what mailing list, otherwise they will just be ignored, like this one :(

thanks,

greg k-h