diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-05-17 07:58:08 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-17 07:58:08 +0200 |
commit | cffc32975da7df2ef909299c47ff644e1357e0ac (patch) | |
tree | 04cfa6276b890f49f686d65be7397c4232ac44af /net/mac80211/sta_info.c | |
parent | 6dc178760553605c58d78bd403dfcb4e042c5b72 (diff) | |
parent | adeb5537849d9db428fe0ddc3562e5a765a347e2 (diff) | |
download | op-kernel-dev-cffc32975da7df2ef909299c47ff644e1357e0ac.zip op-kernel-dev-cffc32975da7df2ef909299c47ff644e1357e0ac.tar.gz |
Merge branch 'x86/asm' into x86/apic, to resolve conflicts
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 12971b7..2880f2a 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -66,6 +66,7 @@ static const struct rhashtable_params sta_rht_params = { .nelem_hint = 3, /* start small */ + .automatic_shrinking = true, .head_offset = offsetof(struct sta_info, hash_node), .key_offset = offsetof(struct sta_info, sta.addr), .key_len = ETH_ALEN, @@ -157,8 +158,24 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, const u8 *addr) { struct ieee80211_local *local = sdata->local; + struct sta_info *sta; + struct rhash_head *tmp; + const struct bucket_table *tbl; + + rcu_read_lock(); + tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); - return rhashtable_lookup_fast(&local->sta_hash, addr, sta_rht_params); + for_each_sta_info(local, tbl, addr, sta, tmp) { + if (sta->sdata == sdata) { + rcu_read_unlock(); + /* this is safe as the caller must already hold + * another rcu read section or the mutex + */ + return sta; + } + } + rcu_read_unlock(); + return NULL; } /* |