From: Mitch A Williams Date: Tue, 9 Dec 2014 08:53:05 +0000 (+0000) Subject: i40evf: remove leftover VLAN filters X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=37dfdf373ce98a7b9fe99478bc40ffaef2ea5eee;p=linux-beck.git i40evf: remove leftover VLAN filters If we're using VLANs and communications with the PF fail during shutdown, we will leak memory because not all of the VLAN filters will be removed. To eliminate this possibility, go through the list again right before the module is removed and delete any leftover entries. Change-ID: Id3b5315c47ca0a61ae123a96ff345d010bc41aed Signed-off-by: Mitch Williams Acked-by: Shannon Nelson Tested-by: Jim Young Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index d3392569485c..994ae4e782d4 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c @@ -2462,6 +2462,10 @@ static void i40evf_remove(struct pci_dev *pdev) list_del(&f->list); kfree(f); } + list_for_each_entry_safe(f, ftmp, &adapter->vlan_filter_list, list) { + list_del(&f->list); + kfree(f); + } free_netdev(netdev);