]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
cxgb4vf: free mac_hlist properly
authorArjun Vynipadath <arjun@chelsio.com>
Fri, 9 Nov 2018 09:22:53 +0000 (14:52 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2018 23:18:48 +0000 (15:18 -0800)
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>
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c

index 972dc7bd721d9a7412e48c429a75eb376a1b5486..8ec503c88c06f8a509c13c819ca078a5db618b1a 100644 (file)
@@ -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.
@@ -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);
        }