diff options
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index a292e8050ef2..babfde9f734c 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -105,6 +105,8 @@ void unregister_vlan_dev(struct net_device *dev, struct list_head *head) | |||
105 | */ | 105 | */ |
106 | unregister_netdevice_queue(dev, head); | 106 | unregister_netdevice_queue(dev, head); |
107 | 107 | ||
108 | netdev_upper_dev_unlink(real_dev, dev); | ||
109 | |||
108 | if (grp->nr_vlan_devs == 0) | 110 | if (grp->nr_vlan_devs == 0) |
109 | vlan_gvrp_uninit_applicant(real_dev); | 111 | vlan_gvrp_uninit_applicant(real_dev); |
110 | 112 | ||
@@ -162,9 +164,13 @@ int register_vlan_dev(struct net_device *dev) | |||
162 | if (err < 0) | 164 | if (err < 0) |
163 | goto out_uninit_applicant; | 165 | goto out_uninit_applicant; |
164 | 166 | ||
167 | err = netdev_upper_dev_link(real_dev, dev); | ||
168 | if (err) | ||
169 | goto out_uninit_applicant; | ||
170 | |||
165 | err = register_netdevice(dev); | 171 | err = register_netdevice(dev); |
166 | if (err < 0) | 172 | if (err < 0) |
167 | goto out_uninit_applicant; | 173 | goto out_upper_dev_unlink; |
168 | 174 | ||
169 | /* Account for reference in struct vlan_dev_priv */ | 175 | /* Account for reference in struct vlan_dev_priv */ |
170 | dev_hold(real_dev); | 176 | dev_hold(real_dev); |
@@ -180,6 +186,8 @@ int register_vlan_dev(struct net_device *dev) | |||
180 | 186 | ||
181 | return 0; | 187 | return 0; |
182 | 188 | ||
189 | out_upper_dev_unlink: | ||
190 | netdev_upper_dev_unlink(real_dev, dev); | ||
183 | out_uninit_applicant: | 191 | out_uninit_applicant: |
184 | if (grp->nr_vlan_devs == 0) | 192 | if (grp->nr_vlan_devs == 0) |
185 | vlan_gvrp_uninit_applicant(real_dev); | 193 | vlan_gvrp_uninit_applicant(real_dev); |