diff options
author | Veaceslav Falico <vfalico@redhat.com> | 2013-09-25 03:20:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-26 16:02:07 -0400 |
commit | 47701a36a3ed6d97e5bbe7ad72cceb49ca329d00 (patch) | |
tree | c68b34b9a1449707de0a9c66239ad6919810cf2f /net/8021q | |
parent | 5df27e6cb2d302e90366848bc3c2bb73c41287fb (diff) |
vlan: unlink the upper neighbour before unregistering
On netdev unregister we're removing also all of its sysfs-associated stuff,
including the sysfs symlinks that are controlled by netdev neighbour code.
Also, it's a subtle race condition - cause we can still access it after
unregistering.
Move the unlinking right before the unregistering to fix both.
CC: Patrick McHardy <kaber@trash.net>
CC: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 69b4a352021f..b3d17d1c49c3 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -98,14 +98,14 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) | |||
98 | vlan_gvrp_request_leave(dev); | 98 | vlan_gvrp_request_leave(dev); |
99 | 99 | ||
100 | vlan_group_set_device(grp, vlan->vlan_proto, vlan_id, NULL); | 100 | vlan_group_set_device(grp, vlan->vlan_proto, vlan_id, NULL); |
101 | |||
102 | netdev_upper_dev_unlink(real_dev, dev); | ||
101 | /* Because unregister_netdevice_queue() makes sure at least one rcu | 103 | /* Because unregister_netdevice_queue() makes sure at least one rcu |
102 | * grace period is respected before device freeing, | 104 | * grace period is respected before device freeing, |
103 | * we dont need to call synchronize_net() here. | 105 | * we dont need to call synchronize_net() here. |
104 | */ | 106 | */ |
105 | unregister_netdevice_queue(dev, head); | 107 | unregister_netdevice_queue(dev, head); |
106 | 108 | ||
107 | netdev_upper_dev_unlink(real_dev, dev); | ||
108 | |||
109 | if (grp->nr_vlan_devs == 0) { | 109 | if (grp->nr_vlan_devs == 0) { |
110 | vlan_mvrp_uninit_applicant(real_dev); | 110 | vlan_mvrp_uninit_applicant(real_dev); |
111 | vlan_gvrp_uninit_applicant(real_dev); | 111 | vlan_gvrp_uninit_applicant(real_dev); |