scsi: lpfc: Fix possible memory leak when failing to issue CMF WQE
[ Upstream commit 2f67dc7970bce3529edce93a0a14234d88b3fcd5 ] There is no corresponding free routine if lpfc_sli4_issue_wqe fails to issue the CMF WQE in lpfc_issue_cmf_sync_wqe. If ret_val is non-zero, then free the iocbq request structure. Link: https://lore.kernel.org/r/20220701211425.2708-6-jsmart2021@gmail.com Co-developed-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b92506dc51
commit
9c8e2e6072
@@ -2012,10 +2012,12 @@ initpath:
|
|||||||
|
|
||||||
sync_buf->cmd_flag |= LPFC_IO_CMF;
|
sync_buf->cmd_flag |= LPFC_IO_CMF;
|
||||||
ret_val = lpfc_sli4_issue_wqe(phba, &phba->sli4_hba.hdwq[0], sync_buf);
|
ret_val = lpfc_sli4_issue_wqe(phba, &phba->sli4_hba.hdwq[0], sync_buf);
|
||||||
if (ret_val)
|
if (ret_val) {
|
||||||
lpfc_printf_log(phba, KERN_INFO, LOG_CGN_MGMT,
|
lpfc_printf_log(phba, KERN_INFO, LOG_CGN_MGMT,
|
||||||
"6214 Cannot issue CMF_SYNC_WQE: x%x\n",
|
"6214 Cannot issue CMF_SYNC_WQE: x%x\n",
|
||||||
ret_val);
|
ret_val);
|
||||||
|
__lpfc_sli_release_iocbq(phba, sync_buf);
|
||||||
|
}
|
||||||
out_unlock:
|
out_unlock:
|
||||||
spin_unlock_irqrestore(&phba->hbalock, iflags);
|
spin_unlock_irqrestore(&phba->hbalock, iflags);
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|||||||
Reference in New Issue
Block a user