aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel/netlabel_domainhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlabel/netlabel_domainhash.c')
-rw-r--r--net/netlabel/netlabel_domainhash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c
index 643c032a3a57..dc42206c4312 100644
--- a/net/netlabel/netlabel_domainhash.c
+++ b/net/netlabel/netlabel_domainhash.c
@@ -115,13 +115,13 @@ static u32 netlbl_domhsh_hash(const char *key)
115static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain) 115static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain)
116{ 116{
117 u32 bkt; 117 u32 bkt;
118 struct list_head *bkt_list;
118 struct netlbl_dom_map *iter; 119 struct netlbl_dom_map *iter;
119 120
120 if (domain != NULL) { 121 if (domain != NULL) {
121 bkt = netlbl_domhsh_hash(domain); 122 bkt = netlbl_domhsh_hash(domain);
122 list_for_each_entry_rcu(iter, 123 bkt_list = &rcu_dereference(netlbl_domhsh)->tbl[bkt];
123 &rcu_dereference(netlbl_domhsh)->tbl[bkt], 124 list_for_each_entry_rcu(iter, bkt_list, list)
124 list)
125 if (iter->valid && strcmp(iter->domain, domain) == 0) 125 if (iter->valid && strcmp(iter->domain, domain) == 0)
126 return iter; 126 return iter;
127 } 127 }
@@ -410,6 +410,7 @@ int netlbl_domhsh_walk(u32 *skip_bkt,
410{ 410{
411 int ret_val = -ENOENT; 411 int ret_val = -ENOENT;
412 u32 iter_bkt; 412 u32 iter_bkt;
413 struct list_head *iter_list;
413 struct netlbl_dom_map *iter_entry; 414 struct netlbl_dom_map *iter_entry;
414 u32 chain_cnt = 0; 415 u32 chain_cnt = 0;
415 416
@@ -417,9 +418,8 @@ int netlbl_domhsh_walk(u32 *skip_bkt,
417 for (iter_bkt = *skip_bkt; 418 for (iter_bkt = *skip_bkt;
418 iter_bkt < rcu_dereference(netlbl_domhsh)->size; 419 iter_bkt < rcu_dereference(netlbl_domhsh)->size;
419 iter_bkt++, chain_cnt = 0) { 420 iter_bkt++, chain_cnt = 0) {
420 list_for_each_entry_rcu(iter_entry, 421 iter_list = &rcu_dereference(netlbl_domhsh)->tbl[iter_bkt];
421 &rcu_dereference(netlbl_domhsh)->tbl[iter_bkt], 422 list_for_each_entry_rcu(iter_entry, iter_list, list)
422 list)
423 if (iter_entry->valid) { 423 if (iter_entry->valid) {
424 if (chain_cnt++ < *skip_chain) 424 if (chain_cnt++ < *skip_chain)
425 continue; 425 continue;