can: dev: Move device back to init netns on owning netns delete
[sfrench/cifs-2.6.git] / net / core / dev.c
index 6c5967e801328a00ffb434a430a865ddcf8c02db..a142a207fc1d5663f9a75094d328a1db3c1b25c9 100644 (file)
@@ -11346,7 +11346,7 @@ static void __net_exit default_device_exit(struct net *net)
                        continue;
 
                /* Leave virtual devices for the generic cleanup */
-               if (dev->rtnl_link_ops)
+               if (dev->rtnl_link_ops && !dev->rtnl_link_ops->netns_refund)
                        continue;
 
                /* Push remaining network devices to init_net */