Skip to contentSkip to conversation

cxgb4vf: free mac_hlist properly

PATCH Applied Arjun Vynipadath 2 participants 2 messages Nov 9, 2018 – Nov 10, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4vf: free mac_hlist properly

The locally maintained list for tracking hash mac table was not freed during driver remove.

---
 drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +6 -0
index 972dc7b..8ec503c 100644
@@ -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);
 	}
 
Signature · 1 line
1.8.3.1