提交 ab0648e8 编写于 作者: R Rajesh Borundia 提交者: David S. Miller

qlcnic: Fix memory leak.

o In case QLC_83XX_MBX_CMD_NO_WAIT command type the calling
  function does not free the memory as it does not wait for
  response. So free it when get a response from adapter after
  sending the command.
Signed-off-by: NRajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: NShahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2c97e9e2
......@@ -1370,7 +1370,7 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
rsp = qlcnic_sriov_alloc_bc_trans(&trans);
if (rsp)
return rsp;
goto free_cmd;
rsp = qlcnic_sriov_prepare_bc_hdr(trans, cmd, seq, QLC_BC_COMMAND);
if (rsp)
......@@ -1425,6 +1425,13 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
cleanup_transaction:
qlcnic_sriov_cleanup_transaction(trans);
free_cmd:
if (cmd->type == QLC_83XX_MBX_CMD_NO_WAIT) {
qlcnic_free_mbx_args(cmd);
kfree(cmd);
}
return rsp;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册