mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
scsi: qla2xxx: Avoid fcport pointer dereference
commit 6b504d0697 upstream.
Klocwork reported warning of NULL pointer may be dereferenced. The routine
exits when sa_ctl is NULL and fcport is allocated after the exit call thus
causing NULL fcport pointer to dereference at the time of exit.
To avoid fcport pointer dereference, exit the routine when sa_ctl is NULL.
Cc: stable@vger.kernel.org
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20230607113843.37185-4-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2b3bdef089
commit
477bc74ad1
@@ -2319,8 +2319,8 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
|
|||||||
if (!sa_ctl) {
|
if (!sa_ctl) {
|
||||||
ql_dbg(ql_dbg_edif, vha, 0x70e6,
|
ql_dbg(ql_dbg_edif, vha, 0x70e6,
|
||||||
"sa_ctl allocation failed\n");
|
"sa_ctl allocation failed\n");
|
||||||
rval = -ENOMEM;
|
rval = -ENOMEM;
|
||||||
goto done;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
fcport = sa_ctl->fcport;
|
fcport = sa_ctl->fcport;
|
||||||
|
|||||||
Reference in New Issue
Block a user