diff options
-rw-r--r-- | net/netlabel/netlabel_domainhash.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c index f46a0aeec44f..b6c844b7e1c1 100644 --- a/net/netlabel/netlabel_domainhash.c +++ b/net/netlabel/netlabel_domainhash.c | |||
@@ -126,7 +126,9 @@ static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain, u32 def) | |||
126 | 126 | ||
127 | if (domain != NULL) { | 127 | if (domain != NULL) { |
128 | bkt = netlbl_domhsh_hash(domain); | 128 | bkt = netlbl_domhsh_hash(domain); |
129 | list_for_each_entry_rcu(iter, &netlbl_domhsh->tbl[bkt], list) | 129 | list_for_each_entry_rcu(iter, |
130 | &rcu_dereference(netlbl_domhsh)->tbl[bkt], | ||
131 | list) | ||
130 | if (iter->valid && strcmp(iter->domain, domain) == 0) | 132 | if (iter->valid && strcmp(iter->domain, domain) == 0) |
131 | return iter; | 133 | return iter; |
132 | } | 134 | } |
@@ -227,7 +229,7 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry, | |||
227 | spin_lock(&netlbl_domhsh_lock); | 229 | spin_lock(&netlbl_domhsh_lock); |
228 | if (netlbl_domhsh_search(entry->domain, 0) == NULL) | 230 | if (netlbl_domhsh_search(entry->domain, 0) == NULL) |
229 | list_add_tail_rcu(&entry->list, | 231 | list_add_tail_rcu(&entry->list, |
230 | &netlbl_domhsh->tbl[bkt]); | 232 | &rcu_dereference(netlbl_domhsh)->tbl[bkt]); |
231 | else | 233 | else |
232 | ret_val = -EEXIST; | 234 | ret_val = -EEXIST; |
233 | spin_unlock(&netlbl_domhsh_lock); | 235 | spin_unlock(&netlbl_domhsh_lock); |
@@ -423,8 +425,8 @@ int netlbl_domhsh_walk(u32 *skip_bkt, | |||
423 | iter_bkt < rcu_dereference(netlbl_domhsh)->size; | 425 | iter_bkt < rcu_dereference(netlbl_domhsh)->size; |
424 | iter_bkt++, chain_cnt = 0) { | 426 | iter_bkt++, chain_cnt = 0) { |
425 | list_for_each_entry_rcu(iter_entry, | 427 | list_for_each_entry_rcu(iter_entry, |
426 | &netlbl_domhsh->tbl[iter_bkt], | 428 | &rcu_dereference(netlbl_domhsh)->tbl[iter_bkt], |
427 | list) | 429 | list) |
428 | if (iter_entry->valid) { | 430 | if (iter_entry->valid) { |
429 | if (chain_cnt++ < *skip_chain) | 431 | if (chain_cnt++ < *skip_chain) |
430 | continue; | 432 | continue; |