aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/if_vlan.h1
-rw-r--r--net/8021q/vlan.c10
2 files changed, 4 insertions, 7 deletions
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 546d9d35fbd4..290bd8ac94cf 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -86,7 +86,6 @@ struct vlan_group {
86 * the vlan is attached to. 86 * the vlan is attached to.
87 */ 87 */
88 unsigned int nr_vlans; 88 unsigned int nr_vlans;
89 int killall;
90 struct hlist_node hlist; /* linked list */ 89 struct hlist_node hlist; /* linked list */
91 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; 90 struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS];
92 struct rcu_head rcu; 91 struct rcu_head rcu;
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 969e7004cf86..718d635d3379 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -120,9 +120,10 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head)
120 grp->nr_vlans--; 120 grp->nr_vlans--;
121 121
122 vlan_group_set_device(grp, vlan_id, NULL); 122 vlan_group_set_device(grp, vlan_id, NULL);
123 if (!grp->killall) 123 /* Because unregister_netdevice_queue() makes sure at least one rcu
124 synchronize_net(); 124 * grace period is respected before device freeing,
125 125 * we dont need to call synchronize_net() here.
126 */
126 unregister_netdevice_queue(dev, head); 127 unregister_netdevice_queue(dev, head);
127 128
128 /* If the group is now empty, kill off the group. */ 129 /* If the group is now empty, kill off the group. */
@@ -478,9 +479,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
478 if (dev->reg_state != NETREG_UNREGISTERING) 479 if (dev->reg_state != NETREG_UNREGISTERING)
479 break; 480 break;
480 481
481 /* Delete all VLANs for this dev. */
482 grp->killall = 1;
483
484 for (i = 0; i < VLAN_N_VID; i++) { 482 for (i = 0; i < VLAN_N_VID; i++) {
485 vlandev = vlan_group_get_device(grp, i); 483 vlandev = vlan_group_get_device(grp, i);
486 if (!vlandev) 484 if (!vlandev)