aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-02-12 14:43:01 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 18:41:19 -0500
commit72100cc43262fa39821b3debc04be1a7a17b3428 (patch)
tree2f313571ee9c9cf4d4a16f2a6e69f82c569b9757 /drivers/scsi/lpfc/lpfc_init.c
parent84d1b006978e78e27f22beb5cfbc4d349bac6df7 (diff)
[SCSI] lpfc 8.3.9: Fix locking and memory issues
- Use the hbalock when changing the fc_flag. - Use the host_lock when changeing the sli_flag. - Prevent NULL pointer dereference after dma_alloc_coherent failure. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 89d886c72e0a..d29ac7c317d9 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2363,6 +2363,7 @@ lpfc_offline_prep(struct lpfc_hba * phba)
2363 struct lpfc_vport *vport = phba->pport; 2363 struct lpfc_vport *vport = phba->pport;
2364 struct lpfc_nodelist *ndlp, *next_ndlp; 2364 struct lpfc_nodelist *ndlp, *next_ndlp;
2365 struct lpfc_vport **vports; 2365 struct lpfc_vport **vports;
2366 struct Scsi_Host *shost;
2366 int i; 2367 int i;
2367 2368
2368 if (vport->fc_flag & FC_OFFLINE_MODE) 2369 if (vport->fc_flag & FC_OFFLINE_MODE)
@@ -2376,13 +2377,14 @@ lpfc_offline_prep(struct lpfc_hba * phba)
2376 vports = lpfc_create_vport_work_array(phba); 2377 vports = lpfc_create_vport_work_array(phba);
2377 if (vports != NULL) { 2378 if (vports != NULL) {
2378 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { 2379 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
2379 struct Scsi_Host *shost;
2380
2381 if (vports[i]->load_flag & FC_UNLOADING) 2380 if (vports[i]->load_flag & FC_UNLOADING)
2382 continue; 2381 continue;
2382 shost = lpfc_shost_from_vport(vports[i]);
2383 spin_lock_irq(shost->host_lock);
2383 vports[i]->vpi_state &= ~LPFC_VPI_REGISTERED; 2384 vports[i]->vpi_state &= ~LPFC_VPI_REGISTERED;
2384 vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 2385 vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
2385 vports[i]->fc_flag &= ~FC_VFI_REGISTERED; 2386 vports[i]->fc_flag &= ~FC_VFI_REGISTERED;
2387 spin_unlock_irq(shost->host_lock);
2386 2388
2387 shost = lpfc_shost_from_vport(vports[i]); 2389 shost = lpfc_shost_from_vport(vports[i]);
2388 list_for_each_entry_safe(ndlp, next_ndlp, 2390 list_for_each_entry_safe(ndlp, next_ndlp,
@@ -2789,8 +2791,6 @@ lpfc_stop_port_s4(struct lpfc_hba *phba)
2789 lpfc_stop_hba_timers(phba); 2791 lpfc_stop_hba_timers(phba);
2790 phba->pport->work_port_events = 0; 2792 phba->pport->work_port_events = 0;
2791 phba->sli4_hba.intr_enable = 0; 2793 phba->sli4_hba.intr_enable = 0;
2792 /* Hard clear it for now, shall have more graceful way to wait later */
2793 phba->sli.sli_flag &= ~LPFC_SLI_MBOX_ACTIVE;
2794} 2794}
2795 2795
2796/** 2796/**