Skip to content

Commit

Permalink
net/core: fix rollback handler in register_netdevice_notifier
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
RongQing.Li authored and David S. Miller committed Dec 1, 2011
1 parent ea6a5d3 commit 8f89148
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 8f89148

Please sign in to comment.