diff options
author | Ganesh Goudar <ganeshgr@chelsio.com> | 2017-06-09 19:26:24 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-09 15:52:50 -0400 |
commit | d0417849152cb5ae08407bcc32b85b55b5b9f591 (patch) | |
tree | cddba2387720b2a9a5ced60967c380a985f2fa35 /drivers/net/ethernet/chelsio/cxgb4 | |
parent | 2f3ca449a4f9a54d2bf39c873269e68ad5f34acb (diff) | |
download | linux-d0417849152cb5ae08407bcc32b85b55b5b9f591.tar.gz linux-d0417849152cb5ae08407bcc32b85b55b5b9f591.tar.bz2 linux-d0417849152cb5ae08407bcc32b85b55b5b9f591.zip |
cxgb4: fix memory leak in init_one()
Free up mbox_log allocated for PF0 to PF3.
Fixes: 7829451c695e ("cxgb4: Add control net_device for configuring PCIe VF")
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index ff8bcf56bf3f..01c9710fc62e 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -5169,13 +5169,15 @@ sriov: &v, &port_vec); if (err < 0) { dev_err(adapter->pdev_dev, "Could not fetch port params\n"); - goto free_adapter; + goto free_mbox_log; } adapter->params.nports = hweight32(port_vec); pci_set_drvdata(pdev, adapter); return 0; +free_mbox_log: + kfree(adapter->mbox_log); free_adapter: kfree(adapter); free_pci_region: @@ -5275,6 +5277,7 @@ static void remove_one(struct pci_dev *pdev) unregister_netdev(adapter->port[0]); iounmap(adapter->regs); kfree(adapter->vfinfo); + kfree(adapter->mbox_log); kfree(adapter); pci_disable_sriov(pdev); pci_release_regions(pdev); @@ -5321,6 +5324,7 @@ static void shutdown_one(struct pci_dev *pdev) unregister_netdev(adapter->port[0]); iounmap(adapter->regs); kfree(adapter->vfinfo); + kfree(adapter->mbox_log); kfree(adapter); pci_disable_sriov(pdev); pci_release_regions(pdev); |