Skip to content

Commit 6b504d0

Browse files
njavalimartinkpetersen
authored andcommitted
scsi: qla2xxx: Avoid fcport pointer dereference
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]>
1 parent 464ea49 commit 6b504d0

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
@@ -2361,8 +2361,8 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
23612361
if (!sa_ctl) {
23622362
ql_dbg(ql_dbg_edif, vha, 0x70e6,
23632363
"sa_ctl allocation failed\n");
2364-
rval = -ENOMEM;
2365-
goto done;
2364+
rval = -ENOMEM;
2365+
return rval;
23662366
}
23672367

23682368
fcport = sa_ctl->fcport;

0 commit comments

Comments
 (0)