diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-04-04 15:45:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-04 15:45:12 -0400 |
commit | 23556323b22fef35bdc36465b7e7439ba3748c9f (patch) | |
tree | a82c7bfe8716a04b183bc9ac0689040be74229bc /net | |
parent | b2a5c19ca0315723cecb9489ff8b67c4f17367b4 (diff) |
[VLAN]: Fix egress priority mappings leak.
These entries are allocated in vlan_dev_set_egress_priority,
but are never released and leaks on vlan device removal.
Drop these in vlan's ->uninit callback - after the device is
brought down and everyone is notified about it is going to
be unregistered.
Found during testing vlan netnsization patchset.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/8021q/vlan_dev.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 480ea90e7dc..41a76a05e6f 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -692,6 +692,20 @@ static int vlan_dev_init(struct net_device *dev) | |||
692 | return 0; | 692 | return 0; |
693 | } | 693 | } |
694 | 694 | ||
695 | static void vlan_dev_uninit(struct net_device *dev) | ||
696 | { | ||
697 | struct vlan_priority_tci_mapping *pm; | ||
698 | struct vlan_dev_info *vlan = vlan_dev_info(dev); | ||
699 | int i; | ||
700 | |||
701 | for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) { | ||
702 | while ((pm = vlan->egress_priority_map[i]) != NULL) { | ||
703 | vlan->egress_priority_map[i] = pm->next; | ||
704 | kfree(pm); | ||
705 | } | ||
706 | } | ||
707 | } | ||
708 | |||
695 | void vlan_setup(struct net_device *dev) | 709 | void vlan_setup(struct net_device *dev) |
696 | { | 710 | { |
697 | ether_setup(dev); | 711 | ether_setup(dev); |
@@ -701,6 +715,7 @@ void vlan_setup(struct net_device *dev) | |||
701 | 715 | ||
702 | dev->change_mtu = vlan_dev_change_mtu; | 716 | dev->change_mtu = vlan_dev_change_mtu; |
703 | dev->init = vlan_dev_init; | 717 | dev->init = vlan_dev_init; |
718 | dev->uninit = vlan_dev_uninit; | ||
704 | dev->open = vlan_dev_open; | 719 | dev->open = vlan_dev_open; |
705 | dev->stop = vlan_dev_stop; | 720 | dev->stop = vlan_dev_stop; |
706 | dev->set_mac_address = vlan_dev_set_mac_address; | 721 | dev->set_mac_address = vlan_dev_set_mac_address; |