Skip to content

Commit

Permalink
cxgb4vf: free mac_hlist properly
Browse files Browse the repository at this point in the history
The locally maintained list for tracking hash mac table was
not freed during driver remove.

Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arjun Vynipadath authored and David S. Miller committed Nov 9, 2018
1 parent 24357e0 commit 40c4b1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3289,6 +3289,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
static void cxgb4vf_pci_remove(struct pci_dev *pdev)
{
struct adapter *adapter = pci_get_drvdata(pdev);
struct hash_mac_addr *entry, *tmp;

/*
* Tear down driver state associated with device.
Expand Down Expand Up @@ -3339,6 +3340,11 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev)
if (!is_t4(adapter->params.chip))
iounmap(adapter->bar2);
kfree(adapter->mbox_log);
list_for_each_entry_safe(entry, tmp, &adapter->mac_hlist,
list) {
list_del(&entry->list);
kfree(entry);
}
kfree(adapter);
}

Expand Down

0 comments on commit 40c4b1e

Please sign in to comment.