diff options
author | Amir Hanania <amir.hanania@intel.com> | 2012-07-09 16:47:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-11 02:32:27 -0400 |
commit | efc73f4bbc238d4f579fb612c04c8e1dd8a82979 (patch) | |
tree | ab92dd7fb1ea7a0f91137cef929c8c107fc9fe45 /net/8021q | |
parent | 941a46a29c9388f9cef518fa3498329fb55badca (diff) |
net: Fix memory leak - vlan_info struct
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>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 6089f0cf23b4..9096bcb08132 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, | |||
403 | break; | 403 | break; |
404 | 404 | ||
405 | case NETDEV_DOWN: | 405 | case NETDEV_DOWN: |
406 | if (dev->features & NETIF_F_HW_VLAN_FILTER) | ||
407 | vlan_vid_del(dev, 0); | ||
408 | |||
406 | /* Put all VLANs for this dev in the down state too. */ | 409 | /* Put all VLANs for this dev in the down state too. */ |
407 | for (i = 0; i < VLAN_N_VID; i++) { | 410 | for (i = 0; i < VLAN_N_VID; i++) { |
408 | vlandev = vlan_group_get_device(grp, i); | 411 | vlandev = vlan_group_get_device(grp, i); |