mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
mac80211: fix station rate table updates on assoc
commit 18fe0fae61 upstream.
If the driver uses .sta_add, station entries are only uploaded after the sta
is in assoc state. Fix early station rate table updates by deferring them
until the sta has been uploaded.
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20210201083324.3134-1-nbd@nbd.name
[use rcu_access_pointer() instead since we won't dereference here]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8ccf963c62
commit
2ca1ddc32b
@@ -125,8 +125,11 @@ int drv_sta_state(struct ieee80211_local *local,
|
|||||||
} else if (old_state == IEEE80211_STA_AUTH &&
|
} else if (old_state == IEEE80211_STA_AUTH &&
|
||||||
new_state == IEEE80211_STA_ASSOC) {
|
new_state == IEEE80211_STA_ASSOC) {
|
||||||
ret = drv_sta_add(local, sdata, &sta->sta);
|
ret = drv_sta_add(local, sdata, &sta->sta);
|
||||||
if (ret == 0)
|
if (ret == 0) {
|
||||||
sta->uploaded = true;
|
sta->uploaded = true;
|
||||||
|
if (rcu_access_pointer(sta->sta.rates))
|
||||||
|
drv_sta_rate_tbl_update(local, sdata, &sta->sta);
|
||||||
|
}
|
||||||
} else if (old_state == IEEE80211_STA_ASSOC &&
|
} else if (old_state == IEEE80211_STA_ASSOC &&
|
||||||
new_state == IEEE80211_STA_AUTH) {
|
new_state == IEEE80211_STA_AUTH) {
|
||||||
drv_sta_remove(local, sdata, &sta->sta);
|
drv_sta_remove(local, sdata, &sta->sta);
|
||||||
|
|||||||
@@ -960,6 +960,7 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
|
|||||||
if (old)
|
if (old)
|
||||||
kfree_rcu(old, rcu_head);
|
kfree_rcu(old, rcu_head);
|
||||||
|
|
||||||
|
if (sta->uploaded)
|
||||||
drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
|
drv_sta_rate_tbl_update(hw_to_local(hw), sta->sdata, pubsta);
|
||||||
|
|
||||||
ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta));
|
ieee80211_sta_set_expected_throughput(pubsta, sta_get_expected_throughput(sta));
|
||||||
|
|||||||
Reference in New Issue
Block a user