Skip to content

Commit 477bc74

Browse files
njavaligregkh
authored andcommitted
scsi: qla2xxx: Avoid fcport pointer dereference
commit 6b504d0 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: [email protected] Signed-off-by: Nilesh Javali <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2b3bdef commit 477bc74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/qla2xxx/qla_edif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,8 +2319,8 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
23192319
if (!sa_ctl) {
23202320
ql_dbg(ql_dbg_edif, vha, 0x70e6,
23212321
"sa_ctl allocation failed\n");
2322-
rval = -ENOMEM;
2323-
goto done;
2322+
rval = -ENOMEM;
2323+
return rval;
23242324
}
23252325

23262326
fcport = sa_ctl->fcport;

0 commit comments

Comments
 (0)