net/core: fix rollback handler in register_netdevice_notifier
authorRongQing.Li <roy.qing.li@gmail.com>
Thu, 1 Dec 2011 04:43:07 +0000 (23:43 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Dec 2011 04:43:07 +0000 (23:43 -0500)
Within nested statements, the break statement terminates only the
do, for, switch, or while statement that immediately encloses it,
So replace the break with goto.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 1482eea0bbf097e6900524f2068f7f18222e2077..5a13edfc9f73411f688920b51400489eb3e89ee2 100644 (file)
@@ -1396,7 +1396,7 @@ rollback:
        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 @@ rollback:
                }
        }
 
+outroll:
        raw_notifier_chain_unregister(&netdev_chain, nb);
        goto unlock;
 }