Callers of br_fdb_find() need to hold the hash lock, which
br_fdb_find_port() doesn't do. Add the missing lock/unlock
pair.

Signed-off-by: Petr Machata <pe...@mellanox.com>
---
 net/bridge/br_fdb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b19e310..3f5691a 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -135,9 +135,11 @@ struct net_device *br_fdb_find_port(const struct 
net_device *br_dev,
                return NULL;
 
        br = netdev_priv(br_dev);
+       spin_lock_bh(&br->hash_lock);
        f = br_fdb_find(br, addr, vid);
        if (f && f->dst)
                dev = f->dst->dev;
+       spin_unlock_bh(&br->hash_lock);
 
        return dev;
 }
-- 
2.4.11

Reply via email to