* [PATCH -next] scsi: qla2xxx: Remove unnecessary null check
@ 2019-07-11 14:09 YueHaibing
2019-07-11 14:13 ` [PATCH v2 " YueHaibing
0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2019-07-11 14:09 UTC (permalink / raw)
To: qla2xxx-upstream, jejb, martin.petersen
Cc: linux-kernel, linux-scsi, YueHaibing
A null check before a kfree is dma_pool_destroy,
so remove it. This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/scsi/qla2xxx/qla_os.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 2e58cff..3c59157 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4731,8 +4731,7 @@ qla2x00_mem_free(struct qla_hw_data *ha)
}
}
- if (ha->dif_bundl_pool)
- dma_pool_destroy(ha->dif_bundl_pool);
+ dma_pool_destroy(ha->dif_bundl_pool);
ha->dif_bundl_pool = NULL;
qlt_mem_free(ha);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 -next] scsi: qla2xxx: Remove unnecessary null check
2019-07-11 14:09 [PATCH -next] scsi: qla2xxx: Remove unnecessary null check YueHaibing
@ 2019-07-11 14:13 ` YueHaibing
2019-07-30 16:08 ` Martin K. Petersen
0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2019-07-11 14:13 UTC (permalink / raw)
To: qla2xxx-upstream, jejb, martin.petersen
Cc: linux-kernel, linux-scsi, YueHaibing
A null check before dma_pool_destroy is redundant,
so remove it. This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: fix commit log
---
drivers/scsi/qla2xxx/qla_os.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 2e58cff..3c59157 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4731,8 +4731,7 @@ qla2x00_mem_free(struct qla_hw_data *ha)
}
}
- if (ha->dif_bundl_pool)
- dma_pool_destroy(ha->dif_bundl_pool);
+ dma_pool_destroy(ha->dif_bundl_pool);
ha->dif_bundl_pool = NULL;
qlt_mem_free(ha);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 -next] scsi: qla2xxx: Remove unnecessary null check
2019-07-11 14:13 ` [PATCH v2 " YueHaibing
@ 2019-07-30 16:08 ` Martin K. Petersen
0 siblings, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-07-30 16:08 UTC (permalink / raw)
To: YueHaibing
Cc: qla2xxx-upstream, jejb, martin.petersen, linux-kernel, linux-scsi
YueHaibing,
> A null check before dma_pool_destroy is redundant,
> so remove it. This is detected by coccinelle.
Applied to 5.4/scsi-queue. Thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-30 16:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 14:09 [PATCH -next] scsi: qla2xxx: Remove unnecessary null check YueHaibing
2019-07-11 14:13 ` [PATCH v2 " YueHaibing
2019-07-30 16:08 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).