diff mbox series

scsi: ipr: remove NULL check before freeing function

Message ID 20200418095903.35118-1-yanaijie@huawei.com (mailing list archive)
State Mainlined
Commit 2e9ef0fcac01a871ab1afcaab9398beeb4d76ea9
Headers show
Series scsi: ipr: remove NULL check before freeing function | expand

Commit Message

Jason Yan April 18, 2020, 9:59 a.m. UTC
Fix the following coccicheck warning:

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

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/scsi/ipr.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin K. Petersen April 27, 2020, 8:21 p.m. UTC | #1
On Sat, 18 Apr 2020 17:59:03 +0800, Jason Yan wrote:

> 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
diff mbox series

Patch

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 0db37b4f7265..7d77997d26d4 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -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);