summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Hanania <amir.hanania@intel.com>2012-07-09 20:47:19 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-09 08:31:41 -0700
commita5b4b62d8517f12c77f912b8c249e36019d31a0c (patch)
tree21a1b8386a690f0544ce2895f4f45f6b303dc33c
parentd680c0462d9f4d96b255853364fb0bcd5c202553 (diff)
net: Fix memory leak - vlan_info struct
[ Upstream commit efc73f4bbc238d4f579fb612c04c8e1dd8a82979 ] In driver reload test there is a memory leak. The structure vlan_info was not freed when the driver was removed. It was not released since the nr_vids var is one after last vlan was removed. The nr_vids is one, since vlan zero is added to the interface when the interface is being set, but the vlan zero is not deleted at unregister. Fix - delete vlan zero when we unregister the device. Signed-off-by: Amir Hanania <amir.hanania@intel.com> Acked-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/8021q/vlan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index efea35b02e7f..cf4a49c5623c 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -403,6 +403,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
break;
case NETDEV_DOWN:
+ if (dev->features & NETIF_F_HW_VLAN_FILTER)
+ vlan_vid_del(dev, 0);
+
/* Put all VLANs for this dev in the down state too. */
for (i = 0; i < VLAN_N_VID; i++) {
vlandev = vlan_group_get_device(grp, i);