mac80211: allocate and fill tidstats only when needed

This fixes memory leaks in the case where we just have the
station info on the stack for internal usage without sending
it to cfg80211.

Fixes: 8689c051a2 ("cfg80211: dynamically allocate per-tid stats for station info")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg
2018-05-18 11:40:44 +02:00
parent 39c1134c66
commit 0fdf1493b4
4 changed files with 10 additions and 8 deletions

View File

@@ -744,7 +744,8 @@ static inline int sta_info_flush(struct ieee80211_sub_if_data *sdata)
void sta_set_rate_info_tx(struct sta_info *sta,
const struct ieee80211_tx_rate *rate,
struct rate_info *rinfo);
void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo);
void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
bool tidstats);
u32 sta_get_expected_throughput(struct sta_info *sta);