* [PATCH][net-next] bridge: use list_for_each_entry_continue_reverse
@ 2014-06-18 8:07 roy.qing.li
2014-06-21 22:33 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: roy.qing.li @ 2014-06-18 8:07 UTC (permalink / raw)
To: netdev
From: Li RongQing <roy.qing.li@gmail.com>
use list_for_each_entry_continue_reverse to rollback in fdb_add_hw
when add address failed
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
net/bridge/br_fdb.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b524c36..7be3366 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -93,7 +93,7 @@ static void fdb_rcu_free(struct rcu_head *head)
static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr)
{
int err;
- struct net_bridge_port *p, *tmp;
+ struct net_bridge_port *p;
ASSERT_RTNL();
@@ -107,11 +107,9 @@ static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr)
return;
undo:
- list_for_each_entry(tmp, &br->port_list, list) {
- if (tmp == p)
- break;
- if (!br_promisc_port(tmp))
- dev_uc_del(tmp->dev, addr);
+ list_for_each_entry_continue_reverse(p, &br->port_list, list) {
+ if (!br_promisc_port(p))
+ dev_uc_del(p->dev, addr);
}
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][net-next] bridge: use list_for_each_entry_continue_reverse
2014-06-18 8:07 [PATCH][net-next] bridge: use list_for_each_entry_continue_reverse roy.qing.li
@ 2014-06-21 22:33 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-06-21 22:33 UTC (permalink / raw)
To: roy.qing.li; +Cc: netdev
From: roy.qing.li@gmail.com
Date: Wed, 18 Jun 2014 16:07:16 +0800
> From: Li RongQing <roy.qing.li@gmail.com>
>
> use list_for_each_entry_continue_reverse to rollback in fdb_add_hw
> when add address failed
>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-06-21 22:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18 8:07 [PATCH][net-next] bridge: use list_for_each_entry_continue_reverse roy.qing.li
2014-06-21 22:33 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.