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:
@@ -108,7 +108,7 @@ static void ieee80211_get_stats(struct net_device *dev,
|
||||
goto do_survey;
|
||||
|
||||
memset(&sinfo, 0, sizeof(sinfo));
|
||||
sta_set_sinfo(sta, &sinfo);
|
||||
sta_set_sinfo(sta, &sinfo, false);
|
||||
|
||||
i = 0;
|
||||
ADD_STA_STATS(sta);
|
||||
@@ -135,7 +135,7 @@ static void ieee80211_get_stats(struct net_device *dev,
|
||||
continue;
|
||||
|
||||
memset(&sinfo, 0, sizeof(sinfo));
|
||||
sta_set_sinfo(sta, &sinfo);
|
||||
sta_set_sinfo(sta, &sinfo, false);
|
||||
i = 0;
|
||||
ADD_STA_STATS(sta);
|
||||
}
|
||||
|
Reference in New Issue
Block a user