diff --git a/net/core/dev.c b/net/core/dev.c index 138951d286432b09a572aff7d745a96d5209acb2..e4b4cb40da00c943a838218634a2d1658aff36c7 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9510,6 +9510,8 @@ static void __net_exit default_device_exit(struct net *net) /* Push remaining network devices to init_net */ snprintf(fb_name, IFNAMSIZ, "dev%d", dev->ifindex); + if (__dev_get_by_name(&init_net, fb_name)) + snprintf(fb_name, IFNAMSIZ, "dev%%d"); err = dev_change_net_namespace(dev, &init_net, fb_name); if (err) { pr_emerg("%s: failed to move %s to init_net: %d\n",