Commit 18c05faf authored by Yang Li's avatar Yang Li Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Remove redundant NULL check

Fix below warnings reported by coccicheck:
./drivers/scsi/qla2xxx/qla_init.c:3371:2-7: WARNING: NULL check before
some freeing functions is not needed.
./drivers/scsi/qla2xxx/qla_init.c:7855:5-10: WARNING: NULL check before
some freeing functions is not needed.
./drivers/scsi/qla2xxx/qla_init.c:7916:2-7: WARNING: NULL check before
some freeing functions is not needed.
./drivers/scsi/qla2xxx/qla_init.c:8113:4-18: WARNING: NULL check before
some freeing functions is not needed.
./drivers/scsi/qla2xxx/qla_init.c:8174:2-7: WARNING: NULL check before
some freeing functions is not needed.

Link: https://lore.kernel.org/r/1611306174-92627-1-git-send-email-abaci-bugfix@linux.alibaba.com


Reported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarYang Li <abaci-bugfix@linux.alibaba.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 12e3ef8b
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -3375,7 +3375,6 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
				    "Re-Allocated (%d KB) and save firmware dump.\n",
				    dump_size / 1024);
			} else {
				if (ha->fw_dump)
				vfree(ha->fw_dump);
				ha->fw_dump = fw_dump;

@@ -7876,7 +7875,6 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
	templates = (risc_attr & BIT_9) ? 2 : 1;
	ql_dbg(ql_dbg_init, vha, 0x0160, "-> templates = %u\n", templates);
	for (j = 0; j < templates; j++, fwdt++) {
		if (fwdt->template)
		vfree(fwdt->template);
		fwdt->template = NULL;
		fwdt->length = 0;
@@ -7937,7 +7935,6 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr,
	return QLA_SUCCESS;

failed:
	if (fwdt->template)
	vfree(fwdt->template);
	fwdt->template = NULL;
	fwdt->length = 0;
@@ -8134,7 +8131,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
	templates = (risc_attr & BIT_9) ? 2 : 1;
	ql_dbg(ql_dbg_init, vha, 0x0170, "-> templates = %u\n", templates);
	for (j = 0; j < templates; j++, fwdt++) {
		if (fwdt->template)
		vfree(fwdt->template);
		fwdt->template = NULL;
		fwdt->length = 0;
@@ -8195,7 +8191,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
	return QLA_SUCCESS;

failed:
	if (fwdt->template)
	vfree(fwdt->template);
	fwdt->template = NULL;
	fwdt->length = 0;