Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f891489 authored by RongQing.Li's avatar RongQing.Li Committed by David S. Miller
Browse files

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: default avatarRongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ea6a5d3b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}