summaryrefslogtreecommitdiffstats
path: root/net/hsr
diff options
context:
space:
mode:
authorAmol Grover <frextrite@gmail.com>2020-02-19 11:00:11 +0100
committerDavid S. Miller <davem@davemloft.net>2020-02-19 19:55:42 +0100
commita7a9456e8d28e81030f7cf6f1f59f907089916a9 (patch)
tree82a639d30e61c709964114dab8272ef01604296c /net/hsr
parentMerge tag 'mlx5-fixes-2020-02-18' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
downloadlinux-a7a9456e8d28e81030f7cf6f1f59f907089916a9.tar.xz
linux-a7a9456e8d28e81030f7cf6f1f59f907089916a9.zip
net: hsr: Pass lockdep expression to RCU lists
node_db is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of hsr->list_lock. Hence, add corresponding lockdep expression to silence false-positive warnings, and harden RCU lists. Signed-off-by: Amol Grover <frextrite@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr')
-rw-r--r--net/hsr/hsr_framereg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 364ea2cc028e..3ba7f61be107 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -155,7 +155,8 @@ static struct hsr_node *hsr_add_node(struct hsr_priv *hsr,
new_node->seq_out[i] = seq_out;
spin_lock_bh(&hsr->list_lock);
- list_for_each_entry_rcu(node, node_db, mac_list) {
+ list_for_each_entry_rcu(node, node_db, mac_list,
+ lockdep_is_held(&hsr->list_lock)) {
if (ether_addr_equal(node->macaddress_A, addr))
goto out;
if (ether_addr_equal(node->macaddress_B, addr))