Subject: vlan 05/06: Move device unregistration before lower dev cleanup

From: Patrick McHardy <[email-masked]>
Date: Thu, 3 Jul 2008 19:04:48 +0200 (MEST)

vlan: Move device unregistration before lower dev cleanup

Move the unregister_netdevice() call for the VLAN device before cleanup
for the lower device. This is needed by GVRP so it can send a leave
message before the applicant on the lower device is cleaned up.

Signed-off-by: Patrick McHardy <[email-masked]>

---
commit 8f8f9dfb07f7c96492d58488d1aaf670329cc91a
tree 7748d32b10dc9342fe36e5f8259d259494c17641
parent 12ad21b911562368e08dc7166109370130c156c7
author Patrick McHardy <[email-masked]> Thu, 03 Jul 2008 18:11:19 +0200
committer Patrick McHardy <[email-masked]> Thu, 03 Jul 2008 18:11:19 +0200

 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 b591bfc..8cae2da 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -165,6 +165,8 @@ void unregister_vlan_dev(struct net_device *dev)
 
 	synchronize_net();
 
+	unregister_netdevice(dev);
+
 	/* If the group is now empty, kill off the group. */
 	if (grp->nr_vlans == 0) {
 		if (real_dev->features & NETIF_F_HW_VLAN_RX)
@@ -178,8 +180,6 @@ void unregister_vlan_dev(struct net_device *dev)
 
 	/* Get rid of the vlan's reference to real_dev */
 	dev_put(real_dev);
-
-	unregister_netdevice(dev);
 }
 
 static void vlan_transfer_operstate(const struct net_device *dev,