Commit 4fdbc67a authored by Maxim Altshul's avatar Maxim Altshul Committed by Johannes Berg

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: default avatarMaxim Altshul <maxim.altshul@ti.com>
[reword commit message]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 12d20fc9
...@@ -1088,13 +1088,13 @@ static inline void drv_leave_ibss(struct ieee80211_local *local, ...@@ -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, static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
struct ieee80211_sta *sta) struct sta_info *sta)
{ {
u32 ret = 0; u32 ret = 0;
trace_drv_get_expected_throughput(sta); trace_drv_get_expected_throughput(&sta->sta);
if (local->ops->get_expected_throughput) if (local->ops->get_expected_throughput && sta->uploaded)
ret = local->ops->get_expected_throughput(&local->hw, sta); ret = local->ops->get_expected_throughput(&local->hw, &sta->sta);
trace_drv_return_u32(local, ret); trace_drv_return_u32(local, ret);
return ret; return ret;
......
...@@ -2301,7 +2301,7 @@ u32 sta_get_expected_throughput(struct sta_info *sta) ...@@ -2301,7 +2301,7 @@ u32 sta_get_expected_throughput(struct sta_info *sta)
if (ref && ref->ops->get_expected_throughput) if (ref && ref->ops->get_expected_throughput)
thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv); thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv);
else else
thr = drv_get_expected_throughput(local, &sta->sta); thr = drv_get_expected_throughput(local, sta);
return thr; return thr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment