[SCSI] lpfc 8.3.31: Fix driver crash during back-to-back ramp events
authorJames Smart <james.smart@emulex.com>
Thu, 10 May 2012 01:18:40 +0000 (21:18 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 17 May 2012 10:08:22 +0000 (11:08 +0100)
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_scsi.c

index d5f3fcc..9434b03 100644 (file)
@@ -399,6 +399,14 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
        num_rsrc_err = atomic_read(&phba->num_rsrc_err);
        num_cmd_success = atomic_read(&phba->num_cmd_success);
 
+       /*
+        * The error and success command counters are global per
+        * driver instance.  If another handler has already
+        * operated on this error event, just exit.
+        */
+       if (num_rsrc_err == 0)
+               return;
+
        vports = lpfc_create_vport_work_array(phba);
        if (vports != NULL)
                for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {