diff options
Diffstat (limited to 'net/8021q/vlan_dev.c')
-rw-r--r-- | net/8021q/vlan_dev.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index ad2ac3c00398..dd11f612e03e 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -627,8 +627,6 @@ static void vlan_dev_uninit(struct net_device *dev) | |||
627 | struct vlan_dev_priv *vlan = vlan_dev_priv(dev); | 627 | struct vlan_dev_priv *vlan = vlan_dev_priv(dev); |
628 | int i; | 628 | int i; |
629 | 629 | ||
630 | free_percpu(vlan->vlan_pcpu_stats); | ||
631 | vlan->vlan_pcpu_stats = NULL; | ||
632 | for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) { | 630 | for (i = 0; i < ARRAY_SIZE(vlan->egress_priority_map); i++) { |
633 | while ((pm = vlan->egress_priority_map[i]) != NULL) { | 631 | while ((pm = vlan->egress_priority_map[i]) != NULL) { |
634 | vlan->egress_priority_map[i] = pm->next; | 632 | vlan->egress_priority_map[i] = pm->next; |
@@ -785,6 +783,15 @@ static const struct net_device_ops vlan_netdev_ops = { | |||
785 | .ndo_get_lock_subclass = vlan_dev_get_lock_subclass, | 783 | .ndo_get_lock_subclass = vlan_dev_get_lock_subclass, |
786 | }; | 784 | }; |
787 | 785 | ||
786 | static void vlan_dev_free(struct net_device *dev) | ||
787 | { | ||
788 | struct vlan_dev_priv *vlan = vlan_dev_priv(dev); | ||
789 | |||
790 | free_percpu(vlan->vlan_pcpu_stats); | ||
791 | vlan->vlan_pcpu_stats = NULL; | ||
792 | free_netdev(dev); | ||
793 | } | ||
794 | |||
788 | void vlan_setup(struct net_device *dev) | 795 | void vlan_setup(struct net_device *dev) |
789 | { | 796 | { |
790 | ether_setup(dev); | 797 | ether_setup(dev); |
@@ -794,7 +801,7 @@ void vlan_setup(struct net_device *dev) | |||
794 | dev->tx_queue_len = 0; | 801 | dev->tx_queue_len = 0; |
795 | 802 | ||
796 | dev->netdev_ops = &vlan_netdev_ops; | 803 | dev->netdev_ops = &vlan_netdev_ops; |
797 | dev->destructor = free_netdev; | 804 | dev->destructor = vlan_dev_free; |
798 | dev->ethtool_ops = &vlan_ethtool_ops; | 805 | dev->ethtool_ops = &vlan_ethtool_ops; |
799 | 806 | ||
800 | memset(dev->broadcast, 0, ETH_ALEN); | 807 | memset(dev->broadcast, 0, ETH_ALEN); |