Skip to content

Commit

Permalink
qlcnic: Fix memory leak.
Browse files Browse the repository at this point in the history
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: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rajesh Borundia authored and David S. Miller committed Apr 24, 2014
1 parent 2c97e9e commit ab0648e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit ab0648e

Please sign in to comment.