]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
vxlan: fix out of order operation on module removal
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 17 Jun 2013 21:16:09 +0000 (14:16 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 24 Jun 2013 15:40:32 +0000 (08:40 -0700)
If vxlan is removed with active vxlan's it would crash because
rtnl_link_unregister (which calls vxlan_dellink), was invoked
before unregister_pernet_device (which calls vxlan_stop).

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/vxlan.c

index 284c6c00c3539c1ddb584b8eb99cbd3f46ccdd6b..d3005d3a768d550912969922030aa65d2cca2107 100644 (file)
@@ -1771,8 +1771,8 @@ late_initcall(vxlan_init_module);
 
 static void __exit vxlan_cleanup_module(void)
 {
-       rtnl_link_unregister(&vxlan_link_ops);
        unregister_pernet_device(&vxlan_net_ops);
+       rtnl_link_unregister(&vxlan_link_ops);
        rcu_barrier();
 }
 module_exit(vxlan_cleanup_module);