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

net: 802: psnap.c: 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
0a087bf2 958a93c1

+1 -1
+1 -1
net/802/psnap.c
··· 30 30 { 31 31 struct datalink_proto *proto = NULL, *p; 32 32 33 - list_for_each_entry_rcu(p, &snap_list, node) { 33 + list_for_each_entry_rcu(p, &snap_list, node, lockdep_is_held(&snap_lock)) { 34 34 if (!memcmp(p->type, desc, 5)) { 35 35 proto = p; 36 36 break;