diff options
author | David S. Miller <davem@davemloft.net> | 2014-04-24 13:31:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-24 13:31:23 -0400 |
commit | 00d0cd38fd570959241cfb3703d8a19e6ef07d86 (patch) | |
tree | bde0399fbd770761fb1b2eb1b96ca75fb4a097f6 | |
parent | ed2da03c6907800871234f5cae42db7d80de8dfc (diff) | |
parent | ab0648e8b6426a009a0e929b137037481b1c2e1e (diff) |
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: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 9 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index dbf75393f758..0bc914859e38 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -2374,6 +2374,14 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter) | |||
2374 | qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd); | 2374 | qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd); |
2375 | } | 2375 | } |
2376 | 2376 | ||
2377 | /* Reset firmware API lock */ | ||
2378 | static void qlcnic_reset_api_lock(struct qlcnic_adapter *adapter) | ||
2379 | { | ||
2380 | qlcnic_api_lock(adapter); | ||
2381 | qlcnic_api_unlock(adapter); | ||
2382 | } | ||
2383 | |||
2384 | |||
2377 | static int | 2385 | static int |
2378 | qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 2386 | qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
2379 | { | 2387 | { |
@@ -2476,6 +2484,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2476 | if (qlcnic_82xx_check(adapter)) { | 2484 | if (qlcnic_82xx_check(adapter)) { |
2477 | qlcnic_check_vf(adapter, ent); | 2485 | qlcnic_check_vf(adapter, ent); |
2478 | adapter->portnum = adapter->ahw->pci_func; | 2486 | adapter->portnum = adapter->ahw->pci_func; |
2487 | qlcnic_reset_api_lock(adapter); | ||
2479 | err = qlcnic_start_firmware(adapter); | 2488 | err = qlcnic_start_firmware(adapter); |
2480 | if (err) { | 2489 | if (err) { |
2481 | dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n" | 2490 | dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n" |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index 0638c1810d54..6afe9c1f5ab9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | |||
@@ -1370,7 +1370,7 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter, | |||
1370 | 1370 | ||
1371 | rsp = qlcnic_sriov_alloc_bc_trans(&trans); | 1371 | rsp = qlcnic_sriov_alloc_bc_trans(&trans); |
1372 | if (rsp) | 1372 | if (rsp) |
1373 | return rsp; | 1373 | goto free_cmd; |
1374 | 1374 | ||
1375 | rsp = qlcnic_sriov_prepare_bc_hdr(trans, cmd, seq, QLC_BC_COMMAND); | 1375 | rsp = qlcnic_sriov_prepare_bc_hdr(trans, cmd, seq, QLC_BC_COMMAND); |
1376 | if (rsp) | 1376 | if (rsp) |
@@ -1425,6 +1425,13 @@ err_out: | |||
1425 | 1425 | ||
1426 | cleanup_transaction: | 1426 | cleanup_transaction: |
1427 | qlcnic_sriov_cleanup_transaction(trans); | 1427 | qlcnic_sriov_cleanup_transaction(trans); |
1428 | |||
1429 | free_cmd: | ||
1430 | if (cmd->type == QLC_83XX_MBX_CMD_NO_WAIT) { | ||
1431 | qlcnic_free_mbx_args(cmd); | ||
1432 | kfree(cmd); | ||
1433 | } | ||
1434 | |||
1428 | return rsp; | 1435 | return rsp; |
1429 | } | 1436 | } |
1430 | 1437 | ||