Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bridge: br_stp: Use built-in RCU list checking

list_for_each_entry_rcu() has built-in RCU and lock checking.

Pass cond argument to list_for_each_entry_rcu() to silence
false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled
by default.

Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Madhuparna Bhowmik and committed by
David S. Miller
33c4acbe c3331d2f

+2 -1
+2 -1
net/bridge/br_stp.c
··· 63 63 { 64 64 struct net_bridge_port *p; 65 65 66 - list_for_each_entry_rcu(p, &br->port_list, list) { 66 + list_for_each_entry_rcu(p, &br->port_list, list, 67 + lockdep_is_held(&br->lock)) { 67 68 if (p->port_no == port_no) 68 69 return p; 69 70 }