netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/core: fix rollback handler in register_netdevice_notifier
@ 2011-12-01  2:37 roy.qing.li
  2011-12-01  4:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: roy.qing.li @ 2011-12-01  2:37 UTC (permalink / raw)
  To: netdev

From: RongQing.Li <roy.qing.li@gmail.com>

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>
---
 net/core/dev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 278463e..88876fa 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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;
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/core: fix rollback handler in register_netdevice_notifier
  2011-12-01  2:37 [PATCH] net/core: fix rollback handler in register_netdevice_notifier roy.qing.li
@ 2011-12-01  4:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-12-01  4:43 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev

From: roy.qing.li@gmail.com
Date: Thu,  1 Dec 2011 10:37:50 +0800

> From: RongQing.Li <roy.qing.li@gmail.com>
> 
> 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>

Good catch, applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-01  4:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01  2:37 [PATCH] net/core: fix rollback handler in register_netdevice_notifier roy.qing.li
2011-12-01  4:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).