]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi/lpfc: Fix driver crash during back-to-back ramp events
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 28 Aug 2012 22:46:21 +0000 (15:46 -0700)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Wed, 5 Sep 2012 19:25:43 +0000 (12:25 -0700)
commit id: 75ad83a452116c00c092bdc4c842c4401cd24080

Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
drivers/scsi/lpfc/lpfc_scsi.c

index 64ca7033a7e47f7a631dd678a791625f8ab36a16..48f93649fbebecc505fb41263bf71ed53519afda 100644 (file)
@@ -398,6 +398,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++) {