Explorar o código

net/core: fix rollback handler in register_netdevice_notifier

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>
RongQing.Li %!s(int64=13) %!d(string=hai) anos
pai
achega
8f89148986
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      net/core/dev.c

+ 2 - 1
net/core/dev.c

@@ -1396,7 +1396,7 @@ rollback:
 	for_each_net(net) {
 	for_each_net(net) {
 		for_each_netdev(net, dev) {
 		for_each_netdev(net, dev) {
 			if (dev == last)
 			if (dev == last)
-				break;
+				goto outroll;
 
 
 			if (dev->flags & IFF_UP) {
 			if (dev->flags & IFF_UP) {
 				nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
 				nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
@@ -1407,6 +1407,7 @@ rollback:
 		}
 		}
 	}
 	}
 
 
+outroll:
 	raw_notifier_chain_unregister(&netdev_chain, nb);
 	raw_notifier_chain_unregister(&netdev_chain, nb);
 	goto unlock;
 	goto unlock;
 }
 }