diff options
author | Chad Dupuis <chad.dupuis@qlogic.com> | 2012-02-09 14:14:04 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-18 09:42:10 -0500 |
commit | aa651be83dfec5587dabce0a9d471c1e2095c33e (patch) | |
tree | fb98cf7e4231342ed49bf8f3b7f784ef599a706a /drivers | |
parent | a55aac79de0ea6fc52d35f535867b6573a5ff0f8 (diff) |
[SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b4b185c7bad6..5fd89d761688 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) | |||
625 | cmd->result = DID_NO_CONNECT << 16; | 625 | cmd->result = DID_NO_CONNECT << 16; |
626 | goto qc24_fail_command; | 626 | goto qc24_fail_command; |
627 | } | 627 | } |
628 | |||
629 | if (!fcport) { | ||
630 | cmd->result = DID_NO_CONNECT << 16; | ||
631 | goto qc24_fail_command; | ||
632 | } | ||
633 | |||
628 | if (atomic_read(&fcport->state) != FCS_ONLINE) { | 634 | if (atomic_read(&fcport->state) != FCS_ONLINE) { |
629 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || | 635 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || |
630 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { | 636 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { |