From 0fdf1493b41eb64fc7e8c8e1b8830a4bd8c4bbca Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 18 May 2018 11:40:44 +0200 Subject: 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: 8689c051a201 ("cfg80211: dynamically allocate per-tid stats for station info") Signed-off-by: Johannes Berg --- net/mac80211/ethtool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/mac80211/ethtool.c') diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c index 2ba5686cbcab..690c142a7a44 100644 --- a/net/mac80211/ethtool.c +++ b/net/mac80211/ethtool.c @@ -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); } -- cgit v1.2.3