diff mbox series

scsi: mpt3sas: remove NULL check before freeing function

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

Commit Message

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

drivers/scsi/mpt3sas/mpt3sas_base.c:4906:3-19: 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/mpt3sas/mpt3sas_base.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:58:50 +0800, Jason Yan wrote:

> Fix the following coccicheck warning:
> 
> drivers/scsi/mpt3sas/mpt3sas_base.c:4906:3-19: WARNING: NULL check
> before some freeing functions is not needed.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: mpt3sas: Remove NULL check before freeing function
      https://git.kernel.org/mkp/scsi/c/baf3fbf26cc0
diff mbox series

Patch

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 663782bb790d..06285b03fa00 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -4902,8 +4902,7 @@  _base_release_memory_pools(struct MPT3SAS_ADAPTER *ioc)
 					ioc->pcie_sg_lookup[i].pcie_sgl,
 					ioc->pcie_sg_lookup[i].pcie_sgl_dma);
 		}
-		if (ioc->pcie_sgl_dma_pool)
-			dma_pool_destroy(ioc->pcie_sgl_dma_pool);
+		dma_pool_destroy(ioc->pcie_sgl_dma_pool);
 	}
 
 	if (ioc->config_page) {