diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 7c28184ad56d..1118b6d49fcc 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -715,6 +715,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) | |||
715 | { | 715 | { |
716 | int i; | 716 | int i; |
717 | LPFC_MBOXQ_t *sparam_mbox, *cfglink_mbox; | 717 | LPFC_MBOXQ_t *sparam_mbox, *cfglink_mbox; |
718 | struct lpfc_dmabuf *mp; | ||
719 | int rc; | ||
720 | |||
718 | sparam_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | 721 | sparam_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
719 | cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | 722 | cfglink_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
720 | 723 | ||
@@ -793,16 +796,27 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la) | |||
793 | if (sparam_mbox) { | 796 | if (sparam_mbox) { |
794 | lpfc_read_sparam(phba, sparam_mbox); | 797 | lpfc_read_sparam(phba, sparam_mbox); |
795 | sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; | 798 | sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; |
796 | lpfc_sli_issue_mbox(phba, sparam_mbox, | 799 | rc = lpfc_sli_issue_mbox(phba, sparam_mbox, |
797 | (MBX_NOWAIT | MBX_STOP_IOCB)); | 800 | (MBX_NOWAIT | MBX_STOP_IOCB)); |
801 | if (rc == MBX_NOT_FINISHED) { | ||
802 | mp = (struct lpfc_dmabuf *) sparam_mbox->context1; | ||
803 | lpfc_mbuf_free(phba, mp->virt, mp->phys); | ||
804 | kfree(mp); | ||
805 | mempool_free(sparam_mbox, phba->mbox_mem_pool); | ||
806 | if (cfglink_mbox) | ||
807 | mempool_free(cfglink_mbox, phba->mbox_mem_pool); | ||
808 | return; | ||
809 | } | ||
798 | } | 810 | } |
799 | 811 | ||
800 | if (cfglink_mbox) { | 812 | if (cfglink_mbox) { |
801 | phba->hba_state = LPFC_LOCAL_CFG_LINK; | 813 | phba->hba_state = LPFC_LOCAL_CFG_LINK; |
802 | lpfc_config_link(phba, cfglink_mbox); | 814 | lpfc_config_link(phba, cfglink_mbox); |
803 | cfglink_mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; | 815 | cfglink_mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; |
804 | lpfc_sli_issue_mbox(phba, cfglink_mbox, | 816 | rc = lpfc_sli_issue_mbox(phba, cfglink_mbox, |
805 | (MBX_NOWAIT | MBX_STOP_IOCB)); | 817 | (MBX_NOWAIT | MBX_STOP_IOCB)); |
818 | if (rc == MBX_NOT_FINISHED) | ||
819 | mempool_free(cfglink_mbox, phba->mbox_mem_pool); | ||
806 | } | 820 | } |
807 | } | 821 | } |
808 | 822 | ||