Skip to contentSkip to conversation

scsi: ipr: remove NULL check before freeing function

PATCH Applied Jason Yan 2 participants 2 messages Apr 18, 2020 – Apr 27, 2020

Subsystems (2)
lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 scsi: ipr: remove NULL check before freeing function

Fix the following coccicheck warning:

drivers/scsi/ipr.c:9533:2-18: WARNING: NULL check before some freeing functions is not needed.

---
 drivers/scsi/ipr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/ipr.c +1 -2
index 0db37b4f7265..7d77997d26d4 100644
@@ -9529,8 +9529,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
 		}
 	}
 
-	if (ioa_cfg->ipr_cmd_pool)
-		dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
+	dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
 
 	kfree(ioa_cfg->ipr_cmnd_list);
 	kfree(ioa_cfg->ipr_cmnd_list_dma);
Signature · 1 line
2.21.1
#1 lore raw
Quoted 4 lines · Jason Yan

Fix the following coccicheck warning:

drivers/scsi/ipr.c:9533:2-18: WARNING: NULL check before some freeing functions is not needed.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: ipr: Remove NULL check before freeing function

      https://git.kernel.org/mkp/scsi/c/2e9ef0fcac01
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering