Use hlist_entry_safe() instead of open-coding it.

Signed-off-by: YueHaibing <yuehaib...@huawei.com>
---
 net/bridge/br_forward.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index b4eed11..7a7fd67 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -274,8 +274,7 @@ void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
                struct net_bridge_port *port, *lport, *rport;
 
                lport = p ? p->port : NULL;
-               rport = rp ? hlist_entry(rp, struct net_bridge_port, rlist) :
-                            NULL;
+               rport = hlist_entry_safe(rp, struct net_bridge_port, rlist);
 
                if ((unsigned long)lport > (unsigned long)rport) {
                        port = lport;
-- 
2.7.0


Reply via email to