net/core: fix rollback handler in register_netdevice_notifier
Subsystems (2)
PATCH 1/1 net/core: fix rollback handler in register_netdevice_notifier
From: RongQing.Li <[email protected]>
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 <[email protected]>
--- net/core/dev.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
net/core/dev.c +2 -1
@@ -1387,7 +1387,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);
@@ -1398,6 +1398,7 @@ rollback: } } +outroll:raw_notifier_chain_unregister (&netdev_chain, nb); goto unlock; }
Signature · 1 line
1.7.1
David Miller
maintainerFrom: [email protected]
Date: Thu, 1 Dec 2011 10:37:50 +0800
Quoted 7 lines
From: RongQing.Li <[email protected]>
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 <[email protected]>
Good catch, applied, thanks.