From: Vaios Papadimitriou Date: Tue, 28 Aug 2012 22:46:21 +0000 (-0700) Subject: scsi/lpfc: Fix driver crash during back-to-back ramp events X-Git-Tag: v2.6.39-400.9.0~314^2~34 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e8229e678899673f910c72e900b8280efa95e9a8;p=users%2Fjedix%2Flinux-maple.git scsi/lpfc: Fix driver crash during back-to-back ramp events commit id: 75ad83a452116c00c092bdc4c842c4401cd24080 Signed-off-by: Jerry Snitselaar --- diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 64ca7033a7e4..48f93649fbeb 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -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++) {