Skip to content

Commit 40c4b1e

Browse files
arjunvynipadathdavem330
authored andcommitted
cxgb4vf: free mac_hlist properly
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>
1 parent 24357e0 commit 40c4b1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,7 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
32893289
static void cxgb4vf_pci_remove(struct pci_dev *pdev)
32903290
{
32913291
struct adapter *adapter = pci_get_drvdata(pdev);
3292+
struct hash_mac_addr *entry, *tmp;
32923293

32933294
/*
32943295
* Tear down driver state associated with device.
@@ -3339,6 +3340,11 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev)
33393340
if (!is_t4(adapter->params.chip))
33403341
iounmap(adapter->bar2);
33413342
kfree(adapter->mbox_log);
3343+
list_for_each_entry_safe(entry, tmp, &adapter->mac_hlist,
3344+
list) {
3345+
list_del(&entry->list);
3346+
kfree(entry);
3347+
}
33423348
kfree(adapter);
33433349
}
33443350

0 commit comments

Comments
 (0)