From: Madhuparna Bhowmik Date: Fri, 21 Feb 2020 16:19:47 +0000 (+0530) Subject: net: 802: psnap.c: Use built-in RCU list checking X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0a087bf232c35dbec3769c4402ca737995d7b734;p=linux.git 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 Signed-off-by: David S. Miller --- diff --git a/net/802/psnap.c b/net/802/psnap.c index 40ab2aea7b315..4492e8d7ad206 100644 --- a/net/802/psnap.c +++ b/net/802/psnap.c @@ -30,7 +30,7 @@ static struct datalink_proto *find_snap_client(const unsigned char *desc) { struct datalink_proto *proto = NULL, *p; - list_for_each_entry_rcu(p, &snap_list, node) { + list_for_each_entry_rcu(p, &snap_list, node, lockdep_is_held(&snap_lock)) { if (!memcmp(p->type, desc, 5)) { proto = p; break;