linux_dsm_epyc7002/drivers/scsi/qla2xxx
Bart Van Assche 17c5f65db6 scsi: qla2xxx: Fix a NULL pointer dereference in an error path
This patch fixes the following Coverity complaint:

FORWARD_NULL

qla_init.c: 5275 in qla2x00_configure_local_loop()
5269
5270     		if (fcport->scan_state == QLA_FCPORT_FOUND)
5271     			qla24xx_fcport_handle_login(vha, fcport);
5272     	}
5273
5274     cleanup_allocation:
>>>     CID 353340:    (FORWARD_NULL)
>>>     Passing null pointer "new_fcport" to "qla2x00_free_fcport", which dereferences it.
5275     	qla2x00_free_fcport(new_fcport);
5276
5277     	if (rval != QLA_SUCCESS) {
5278     		ql_dbg(ql_dbg_disc, vha, 0x2098,
5279     		    "Configure local loop error exit: rval=%x.\n", rval);
5280     	}
qla_init.c: 5275 in qla2x00_configure_local_loop()
5269
5270     		if (fcport->scan_state == QLA_FCPORT_FOUND)
5271     			qla24xx_fcport_handle_login(vha, fcport);
5272     	}
5273
5274     cleanup_allocation:
>>>     CID 353340:    (FORWARD_NULL)
>>>     Passing null pointer "new_fcport" to "qla2x00_free_fcport", which dereferences it.
5275     	qla2x00_free_fcport(new_fcport);
5276
5277     	if (rval != QLA_SUCCESS) {
5278     		ql_dbg(ql_dbg_disc, vha, 0x2098,
5279     		    "Configure local loop error exit: rval=%x.\n", rval);
5280     	}

Fixes: 3dae220595 ("scsi: qla2xxx: Use common routine to free fcport struct")
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Link: https://lore.kernel.org/r/20200118042056.32232-1-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-01-20 18:38:20 -05:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qla_attr.c scsi: qla2xxx: Correctly retrieve and interpret active flash region 2019-12-09 18:03:07 -05:00
qla_bsg.c scsi: qla2xxx: Use get_unaligned_*() instead of open-coding these functions 2020-01-02 21:53:31 -05:00
qla_bsg.h scsi: qla2xxx: Add 28xx flash primary/secondary status/image mechanism 2019-03-19 12:22:55 -04:00
qla_dbg.c scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport 2019-12-19 22:42:44 -05:00
qla_dbg.h scsi: qla2xxx: Cleanups for NVRAM/Flash read/write path 2019-03-19 12:22:54 -04:00
qla_def.h scsi: qla2xxx: Improve readability of the code that handles qla_flt_header 2020-01-02 21:53:30 -05:00
qla_devtbl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
qla_dfs.c scsi: qla2xxx: Reduce the number of casts in GID list code 2019-08-12 21:34:05 -04:00
qla_dsd.h scsi: qla2xxx: Include the <asm/unaligned.h> header file from qla_dsd.h 2019-08-12 21:34:04 -04:00
qla_fw.h scsi: qla2xxx: Improve readability of the code that handles qla_flt_header 2020-01-02 21:53:30 -05:00
qla_gbl.h scsi: qla2xxx: Use common routine to free fcport struct 2019-12-19 22:42:45 -05:00
qla_gs.c scsi: qla2xxx: Correct fcport flags handling 2019-12-21 13:42:41 -05:00
qla_init.c scsi: qla2xxx: Fix a NULL pointer dereference in an error path 2020-01-20 18:38:20 -05:00
qla_inline.h scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport 2019-12-19 22:42:44 -05:00
qla_iocb.c scsi: qla2xxx: Correct fcport flags handling 2019-12-21 13:42:41 -05:00
qla_isr.c scsi: qla2xxx: Use get_unaligned_*() instead of open-coding these functions 2020-01-02 21:53:31 -05:00
qla_mbx.c scsi: qla2xxx: Fix mtcp dump collection failure 2019-12-21 13:42:41 -05:00
qla_mid.c scsi: qla2xxx: Remove defer flag to indicate immeadiate port loss 2019-12-19 22:42:44 -05:00
qla_mr.c scsi: qla2xxx: Use common routine to free fcport struct 2019-12-19 22:42:45 -05:00
qla_mr.h scsi: qla2xxx: Introduce the dsd32 and dsd64 data structures 2019-04-29 17:24:51 -04:00
qla_nvme.c for-linus-20191212 2019-12-13 14:27:19 -08:00
qla_nvme.h scsi: qla2xxx: Modify NVMe include directives 2019-08-12 21:34:08 -04:00
qla_nx2.c scsi: qla2xxx: Suppress a Coveritiy complaint about integer overflow 2019-08-12 21:34:07 -04:00
qla_nx2.h scsi: qla2xxx: Remove unused symbols 2018-02-12 11:43:24 -05:00
qla_nx.c scsi: qla2xxx: Use get_unaligned_*() instead of open-coding these functions 2020-01-02 21:53:31 -05:00
qla_nx.h scsi: qla2xxx: Improve Linux kernel coding style conformance 2019-08-12 21:34:04 -04:00
qla_os.c scsi: qla2xxx: Improve readability of the code that handles qla_flt_header 2020-01-02 21:53:30 -05:00
qla_settings.h
qla_sup.c scsi: qla2xxx: Improve readability of the code that handles qla_flt_header 2020-01-02 21:53:30 -05:00
qla_target.c scsi: qla2xxx: Use get_unaligned_*() instead of open-coding these functions 2020-01-02 21:53:31 -05:00
qla_target.h scsi: qla2xxx: Use get_unaligned_*() instead of open-coding these functions 2020-01-02 21:53:31 -05:00
qla_tmpl.c scsi: qla2xxx: Capture FW dump on MPI heartbeat stop event 2019-10-09 22:26:35 -04:00
qla_tmpl.h scsi: qla2xxx: Correction and improvement to fwdt processing 2019-03-19 12:22:55 -04:00
qla_version.h scsi: qla2xxx: Update driver version to 10.01.00.22-k 2019-12-21 13:42:41 -05:00
tcm_qla2xxx.c scsi: qla2xxx: Use explicit LOGO in target mode 2019-12-09 18:27:49 -05:00
tcm_qla2xxx.h scsi: qla2xxx: deadlock by configfs_depend_item 2018-12-19 21:26:38 -05:00