diff options
author | Amol Grover <frextrite@gmail.com> | 2020-03-12 11:04:20 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-11 22:55:25 -0700 |
commit | f9fc28a8de2fb367f1ab76f0cf176ca545db3d6f (patch) | |
tree | 030a3793ef5e3c6e2bdb97143640e17aef73827f /net/caif | |
parent | eecba79e694eda24ba698fe1bdf0466d2f797b42 (diff) | |
download | lwn-f9fc28a8de2fb367f1ab76f0cf176ca545db3d6f.tar.gz lwn-f9fc28a8de2fb367f1ab76f0cf176ca545db3d6f.zip |
net: caif: Add lockdep expression to RCU traversal primitive
caifdevs->list is traversed using list_for_each_entry_rcu()
outside an RCU read-side critical section but under the
protection of rtnl_mutex. Hence, add the corresponding lockdep
expression to silence the following false-positive warning:
[ 10.868467] =============================
[ 10.869082] WARNING: suspicious RCU usage
[ 10.869817] 5.6.0-rc1-00177-g06ec0a154aae4 #1 Not tainted
[ 10.870804] -----------------------------
[ 10.871557] net/caif/caif_dev.c:115 RCU-list traversed in non-reader section!!
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Amol Grover <frextrite@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
-rw-r--r-- | net/caif/caif_dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 03c7cdd8e4cb..195d2d67be8a 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c @@ -112,7 +112,8 @@ static struct caif_device_entry *caif_get(struct net_device *dev) caif_device_list(dev_net(dev)); struct caif_device_entry *caifd; - list_for_each_entry_rcu(caifd, &caifdevs->list, list) { + list_for_each_entry_rcu(caifd, &caifdevs->list, list, + lockdep_rtnl_is_held()) { if (caifd->netdev == dev) return caifd; } |