diff options
author | Maxim Altshul <maxim.altshul@ti.com> | 2016-08-11 13:38:16 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2016-08-11 20:00:37 +0200 |
commit | 4fdbc67a25ce577b79b3af595e874e9ef921329f (patch) | |
tree | ac0650b0e51223b96cbfead2ff2f0af654889b37 /net/mac80211/driver-ops.h | |
parent | 12d20fc9186a742d40e824f575df5aa62be31d69 (diff) | |
download | linux-stable-4fdbc67a25ce577b79b3af595e874e9ef921329f.tar.gz linux-stable-4fdbc67a25ce577b79b3af595e874e9ef921329f.tar.bz2 linux-stable-4fdbc67a25ce577b79b3af595e874e9ef921329f.zip |
mac80211: call get_expected_throughput only after adding station
Depending on which method the driver implements, userspace could
call this (indirectly, by getting station info) before the driver
knows about the station, possibly causing it to misbehave.
Therefore, add a check for sta->uploaded which indicates that the
driver knows about the station.
Signed-off-by: Maxim Altshul <maxim.altshul@ti.com>
[reword commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index ba5fc1f01e53..42a41ae405ba 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1088,13 +1088,13 @@ static inline void drv_leave_ibss(struct ieee80211_local *local, } static inline u32 drv_get_expected_throughput(struct ieee80211_local *local, - struct ieee80211_sta *sta) + struct sta_info *sta) { u32 ret = 0; - trace_drv_get_expected_throughput(sta); - if (local->ops->get_expected_throughput) - ret = local->ops->get_expected_throughput(&local->hw, sta); + trace_drv_get_expected_throughput(&sta->sta); + if (local->ops->get_expected_throughput && sta->uploaded) + ret = local->ops->get_expected_throughput(&local->hw, &sta->sta); trace_drv_return_u32(local, ret); return ret; |