aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hbadisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 2359d0bfb734..e58d8aeec09e 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -2024,8 +2024,6 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
2024 int rc; 2024 int rc;
2025 struct fcf_record *fcf_record; 2025 struct fcf_record *fcf_record;
2026 2026
2027 sparam_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
2028
2029 spin_lock_irq(&phba->hbalock); 2027 spin_lock_irq(&phba->hbalock);
2030 switch (la->UlnkSpeed) { 2028 switch (la->UlnkSpeed) {
2031 case LA_1GHZ_LINK: 2029 case LA_1GHZ_LINK:
@@ -2117,18 +2115,24 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
2117 spin_unlock_irq(&phba->hbalock); 2115 spin_unlock_irq(&phba->hbalock);
2118 2116
2119 lpfc_linkup(phba); 2117 lpfc_linkup(phba);
2120 if (sparam_mbox) { 2118 sparam_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
2121 lpfc_read_sparam(phba, sparam_mbox, 0); 2119 if (!sparam_mbox)
2122 sparam_mbox->vport = vport; 2120 goto out;
2123 sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; 2121
2124 rc = lpfc_sli_issue_mbox(phba, sparam_mbox, MBX_NOWAIT); 2122 rc = lpfc_read_sparam(phba, sparam_mbox, 0);
2125 if (rc == MBX_NOT_FINISHED) { 2123 if (rc) {
2126 mp = (struct lpfc_dmabuf *) sparam_mbox->context1; 2124 mempool_free(sparam_mbox, phba->mbox_mem_pool);
2127 lpfc_mbuf_free(phba, mp->virt, mp->phys); 2125 goto out;
2128 kfree(mp); 2126 }
2129 mempool_free(sparam_mbox, phba->mbox_mem_pool); 2127 sparam_mbox->vport = vport;
2130 goto out; 2128 sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam;
2131 } 2129 rc = lpfc_sli_issue_mbox(phba, sparam_mbox, MBX_NOWAIT);
2130 if (rc == MBX_NOT_FINISHED) {
2131 mp = (struct lpfc_dmabuf *) sparam_mbox->context1;
2132 lpfc_mbuf_free(phba, mp->virt, mp->phys);
2133 kfree(mp);
2134 mempool_free(sparam_mbox, phba->mbox_mem_pool);
2135 goto out;
2132 } 2136 }
2133 2137
2134 if (!(phba->hba_flag & HBA_FCOE_SUPPORT)) { 2138 if (!(phba->hba_flag & HBA_FCOE_SUPPORT)) {