diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 3feeb447b740..b6fa257ea3e0 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -5173,7 +5173,6 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, | |||
5173 | rjt_err = LSRJT_CMD_UNSUPPORTED; | 5173 | rjt_err = LSRJT_CMD_UNSUPPORTED; |
5174 | goto rjt; | 5174 | goto rjt; |
5175 | } | 5175 | } |
5176 | lcb_context = kmalloc(sizeof(struct lpfc_lcb_context), GFP_KERNEL); | ||
5177 | 5176 | ||
5178 | if (phba->hba_flag & HBA_FCOE_MODE) { | 5177 | if (phba->hba_flag & HBA_FCOE_MODE) { |
5179 | rjt_err = LSRJT_CMD_UNSUPPORTED; | 5178 | rjt_err = LSRJT_CMD_UNSUPPORTED; |
@@ -5204,6 +5203,12 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, | |||
5204 | goto rjt; | 5203 | goto rjt; |
5205 | } | 5204 | } |
5206 | 5205 | ||
5206 | lcb_context = kmalloc(sizeof(*lcb_context), GFP_KERNEL); | ||
5207 | if (!lcb_context) { | ||
5208 | rjt_err = LSRJT_UNABLE_TPC; | ||
5209 | goto rjt; | ||
5210 | } | ||
5211 | |||
5207 | state = (beacon->lcb_sub_command == LPFC_LCB_ON) ? 1 : 0; | 5212 | state = (beacon->lcb_sub_command == LPFC_LCB_ON) ? 1 : 0; |
5208 | lcb_context->sub_command = beacon->lcb_sub_command; | 5213 | lcb_context->sub_command = beacon->lcb_sub_command; |
5209 | lcb_context->type = beacon->lcb_type; | 5214 | lcb_context->type = beacon->lcb_type; |
@@ -5214,6 +5219,7 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, | |||
5214 | if (lpfc_sli4_set_beacon(vport, lcb_context, state)) { | 5219 | if (lpfc_sli4_set_beacon(vport, lcb_context, state)) { |
5215 | lpfc_printf_vlog(ndlp->vport, KERN_ERR, | 5220 | lpfc_printf_vlog(ndlp->vport, KERN_ERR, |
5216 | LOG_ELS, "0193 failed to send mail box"); | 5221 | LOG_ELS, "0193 failed to send mail box"); |
5222 | kfree(lcb_context); | ||
5217 | lpfc_nlp_put(ndlp); | 5223 | lpfc_nlp_put(ndlp); |
5218 | rjt_err = LSRJT_UNABLE_TPC; | 5224 | rjt_err = LSRJT_UNABLE_TPC; |
5219 | goto rjt; | 5225 | goto rjt; |