Commit eb5a3e3b authored by Qiheng Lin's avatar Qiheng Lin Committed by Martin K. Petersen

scsi: qla4xxx: Remove unneeded if-null-free check

Eliminate the following coccicheck warning:

drivers/scsi/qla4xxx/ql4_os.c:4175:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:4196:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:4215:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6400:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6402:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6555:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:6557:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:7838:2-7: WARNING:
 NULL check before some freeing functions is not needed.
drivers/scsi/qla4xxx/ql4_os.c:7840:2-7: WARNING:
 NULL check before some freeing functions is not needed.

Link: https://lore.kernel.org/r/20210409120345.6447-1-linqiheng@huawei.comSigned-off-by: default avatarQiheng Lin <linqiheng@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 5dc34688
...@@ -4171,8 +4171,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha) ...@@ -4171,8 +4171,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
dma_free_coherent(&ha->pdev->dev, ha->queues_len, ha->queues, dma_free_coherent(&ha->pdev->dev, ha->queues_len, ha->queues,
ha->queues_dma); ha->queues_dma);
if (ha->fw_dump) vfree(ha->fw_dump);
vfree(ha->fw_dump);
ha->queues_len = 0; ha->queues_len = 0;
ha->queues = NULL; ha->queues = NULL;
...@@ -4192,8 +4191,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha) ...@@ -4192,8 +4191,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
dma_pool_destroy(ha->chap_dma_pool); dma_pool_destroy(ha->chap_dma_pool);
if (ha->chap_list) vfree(ha->chap_list);
vfree(ha->chap_list);
ha->chap_list = NULL; ha->chap_list = NULL;
dma_pool_destroy(ha->fw_ddb_dma_pool); dma_pool_destroy(ha->fw_ddb_dma_pool);
...@@ -4211,8 +4209,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha) ...@@ -4211,8 +4209,7 @@ static void qla4xxx_mem_free(struct scsi_qla_host *ha)
iounmap(ha->reg); iounmap(ha->reg);
} }
if (ha->reset_tmplt.buff) vfree(ha->reset_tmplt.buff);
vfree(ha->reset_tmplt.buff);
pci_release_regions(ha->pdev); pci_release_regions(ha->pdev);
} }
...@@ -6396,10 +6393,8 @@ static int qla4xxx_is_session_exists(struct scsi_qla_host *ha, ...@@ -6396,10 +6393,8 @@ static int qla4xxx_is_session_exists(struct scsi_qla_host *ha,
} }
exit_check: exit_check:
if (fw_tddb) vfree(fw_tddb);
vfree(fw_tddb); vfree(tmp_tddb);
if (tmp_tddb)
vfree(tmp_tddb);
return ret; return ret;
} }
...@@ -6551,10 +6546,8 @@ static int qla4xxx_is_flash_ddb_exists(struct scsi_qla_host *ha, ...@@ -6551,10 +6546,8 @@ static int qla4xxx_is_flash_ddb_exists(struct scsi_qla_host *ha,
} }
exit_check: exit_check:
if (fw_tddb) vfree(fw_tddb);
vfree(fw_tddb); vfree(tmp_tddb);
if (tmp_tddb)
vfree(tmp_tddb);
return ret; return ret;
} }
...@@ -7834,10 +7827,8 @@ static int qla4xxx_sysfs_ddb_logout(struct iscsi_bus_flash_session *fnode_sess, ...@@ -7834,10 +7827,8 @@ static int qla4xxx_sysfs_ddb_logout(struct iscsi_bus_flash_session *fnode_sess,
ret = -ESRCH; ret = -ESRCH;
exit_ddb_logout: exit_ddb_logout:
if (flash_tddb) vfree(flash_tddb);
vfree(flash_tddb); vfree(tmp_tddb);
if (tmp_tddb)
vfree(tmp_tddb);
if (fw_ddb_entry) if (fw_ddb_entry)
dma_pool_free(ha->fw_ddb_dma_pool, fw_ddb_entry, fw_ddb_dma); dma_pool_free(ha->fw_ddb_dma_pool, fw_ddb_entry, fw_ddb_dma);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment