summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorQiheng Lin <linqiheng@huawei.com>2021-04-09 20:09:25 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2021-04-13 00:35:27 -0400
commitefd2617100d9c6a49c8cd27160a2353b04844d78 (patch)
tree2ed739b98acea4750477e62abf278f06c8f7ade8 /drivers/scsi/qla2xxx
parent16660db3fc2af8664af5e0a3cac69c4a54bfb794 (diff)
downloadlinux-stable-efd2617100d9c6a49c8cd27160a2353b04844d78.tar.gz
linux-stable-efd2617100d9c6a49c8cd27160a2353b04844d78.tar.bz2
linux-stable-efd2617100d9c6a49c8cd27160a2353b04844d78.zip
scsi: qla2xxx: Remove unneeded if-null-free check
Eliminate the following coccicheck warning: drivers/scsi/qla2xxx/qla_os.c:4622:2-7: WARNING: NULL check before some freeing functions is not needed. drivers/scsi/qla2xxx/qla_os.c:4637:3-8: WARNING: NULL check before some freeing functions is not needed. Link: https://lore.kernel.org/r/20210409120925.7122-1-linqiheng@huawei.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Qiheng Lin <linqiheng@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 12959e3874cb..d74c32f84ef5 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4618,8 +4618,7 @@ qla2x00_free_fw_dump(struct qla_hw_data *ha)
dma_free_coherent(&ha->pdev->dev,
EFT_SIZE, ha->eft, ha->eft_dma);
- if (ha->fw_dump)
- vfree(ha->fw_dump);
+ vfree(ha->fw_dump);
ha->fce = NULL;
ha->fce_dma = 0;
@@ -4633,8 +4632,7 @@ qla2x00_free_fw_dump(struct qla_hw_data *ha)
ha->fw_dump_len = 0;
for (j = 0; j < 2; j++, fwdt++) {
- if (fwdt->template)
- vfree(fwdt->template);
+ vfree(fwdt->template);
fwdt->template = NULL;
fwdt->length = 0;
}