bridge: use list_for_each_entry_continue_reverse
Subsystems (3)
PATCH 1/1 bridge: use list_for_each_entry_continue_reverse
From: Li RongQing <[email protected]>
use list_for_each_entry_continue_reverse to rollback in fdb_add_hw when add address failed
Signed-off-by Li RongQing <[email protected]>
--- net/bridge/br_fdb.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
net/bridge/br_fdb.c +4 -6
@@ -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); } }
Signature · 1 line
1.7.10.4
From: [email protected]
Date: Wed, 18 Jun 2014 16:07:16 +0800
Quoted 6 lines
From: Li RongQing <[email protected]>
use
list_for_each_entry_continue_reverseto rollback infdb_add_hwwhen add address failedSigned-off-by Li RongQing <[email protected]>
Applied to net-next, thanks.