summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_fdb.c
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2014-06-18 16:07:16 +0800
committerDavid S. Miller <davem@davemloft.net>2014-06-21 15:33:22 -0700
commita3f5ee71cdec56543e0420a788dc7df335944dd5 (patch)
tree134c1fbba4689c50eb7c0cdc76961425da67836e /net/bridge/br_fdb.c
parent545a112bb3dcf8e4574fc985f07bf7ea03a7f809 (diff)
downloadlinux-a3f5ee71cdec56543e0420a788dc7df335944dd5.tar.bz2
bridge: use list_for_each_entry_continue_reverse
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_fdb.c')
-rw-r--r--net/bridge/br_fdb.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b524c36c1273..7be33667a839 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);
}
}