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

netlabel_domainhash.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
9facfdb5 8c70c3d7

+2 -1
+2 -1
net/netlabel/netlabel_domainhash.c
··· 143 143 if (domain != NULL) { 144 144 bkt = netlbl_domhsh_hash(domain); 145 145 bkt_list = &netlbl_domhsh_rcu_deref(netlbl_domhsh)->tbl[bkt]; 146 - list_for_each_entry_rcu(iter, bkt_list, list) 146 + list_for_each_entry_rcu(iter, bkt_list, list, 147 + lockdep_is_held(&netlbl_domhsh_lock)) 147 148 if (iter->valid && 148 149 netlbl_family_match(iter->family, family) && 149 150 strcmp(iter->domain, domain) == 0)