[SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand.
authorChad Dupuis <chad.dupuis@qlogic.com>
Thu, 9 Feb 2012 19:14:04 +0000 (11:14 -0800)
committerJames Bottomley <JBottomley@Parallels.com>
Sat, 18 Feb 2012 14:42:10 +0000 (08:42 -0600)
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>
drivers/scsi/qla2xxx/qla_os.c

index b4b185c..5fd89d7 100644 (file)
@@ -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) {