netlabel_domainhash.c: Use built-in RCU list checking
authorMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Tue, 18 Feb 2020 18:41:32 +0000 (00:11 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Feb 2020 20:44:23 +0000 (12:44 -0800)
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>
net/netlabel/netlabel_domainhash.c

index f5d34da0646eda1647a39300252ff1249c8b01eb..a1f2320ecc16d1450525123fe6f217ddb8203b76 100644 (file)
@@ -143,7 +143,8 @@ static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain,
        if (domain != NULL) {
                bkt = netlbl_domhsh_hash(domain);
                bkt_list = &netlbl_domhsh_rcu_deref(netlbl_domhsh)->tbl[bkt];
-               list_for_each_entry_rcu(iter, bkt_list, list)
+               list_for_each_entry_rcu(iter, bkt_list, list,
+                                       lockdep_is_held(&netlbl_domhsh_lock))
                        if (iter->valid &&
                            netlbl_family_match(iter->family, family) &&
                            strcmp(iter->domain, domain) == 0)