diff --git a/net/core/dev.c b/net/core/dev.c index 1482eea0bbf097e6900524f2068f7f18222e2077..5a13edfc9f73411f688920b51400489eb3e89ee2 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1396,7 +1396,7 @@ int register_netdevice_notifier(struct notifier_block *nb) for_each_net(net) { for_each_netdev(net, dev) { if (dev == last) - break; + goto outroll; if (dev->flags & IFF_UP) { nb->notifier_call(nb, NETDEV_GOING_DOWN, dev); @@ -1407,6 +1407,7 @@ int register_netdevice_notifier(struct notifier_block *nb) } } +outroll: raw_notifier_chain_unregister(&netdev_chain, nb); goto unlock; }