Skip to content

Commit

Permalink
[SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queue…
Browse files Browse the repository at this point in the history
…command.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Chad Dupuis authored and James Bottomley committed Feb 18, 2012
1 parent a55aac7 commit aa651be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command;
}

if (!fcport) {
cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command;
}

if (atomic_read(&fcport->state) != FCS_ONLINE) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
Expand Down

0 comments on commit aa651be

Please sign in to comment.