Commit 00d0cd38 authored by David S. Miller's avatar David S. Miller

Merge branch 'qlcnic-net'

Shahed Shaikh says:

====================
qlcnic: Bug fixes

This patch series contains following fixes -

* Fix memory leak caused because of issuing mailbox
  command which can not wait for its completion.
* Reset firmware API lock which might be in inconsistent state.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents ed2da03c ab0648e8
...@@ -2374,6 +2374,14 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter) ...@@ -2374,6 +2374,14 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter)
qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd); qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd);
} }
/* Reset firmware API lock */
static void qlcnic_reset_api_lock(struct qlcnic_adapter *adapter)
{
qlcnic_api_lock(adapter);
qlcnic_api_unlock(adapter);
}
static int static int
qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
...@@ -2476,6 +2484,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2476,6 +2484,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (qlcnic_82xx_check(adapter)) { if (qlcnic_82xx_check(adapter)) {
qlcnic_check_vf(adapter, ent); qlcnic_check_vf(adapter, ent);
adapter->portnum = adapter->ahw->pci_func; adapter->portnum = adapter->ahw->pci_func;
qlcnic_reset_api_lock(adapter);
err = qlcnic_start_firmware(adapter); err = qlcnic_start_firmware(adapter);
if (err) { if (err) {
dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n" dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"
......
...@@ -1370,7 +1370,7 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter, ...@@ -1370,7 +1370,7 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
rsp = qlcnic_sriov_alloc_bc_trans(&trans); rsp = qlcnic_sriov_alloc_bc_trans(&trans);
if (rsp) if (rsp)
return rsp; goto free_cmd;
rsp = qlcnic_sriov_prepare_bc_hdr(trans, cmd, seq, QLC_BC_COMMAND); rsp = qlcnic_sriov_prepare_bc_hdr(trans, cmd, seq, QLC_BC_COMMAND);
if (rsp) if (rsp)
...@@ -1425,6 +1425,13 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter, ...@@ -1425,6 +1425,13 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
cleanup_transaction: cleanup_transaction:
qlcnic_sriov_cleanup_transaction(trans); 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; return rsp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment