cfg80211: release station info tidstats where needed

This fixes memory leaks in cases where we got the station
info but failed sending it out properly.

Fixes: 8689c051a2 ("cfg80211: dynamically allocate per-tid stats for station info")
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
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 0fdf1493b4
commit 7ea3e110f2
2 changed files with 21 additions and 3 deletions

View File

@@ -5710,6 +5710,19 @@ void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
*/
int cfg80211_sinfo_alloc_tid_stats(struct station_info *sinfo, gfp_t gfp);
/**
* cfg80211_sinfo_release_content - release contents of station info
* @sinfo: the station information
*
* Releases any potentially allocated sub-information of the station
* information, but not the struct itself (since it's typically on
* the stack.)
*/
static inline void cfg80211_sinfo_release_content(struct station_info *sinfo)
{
kfree(sinfo->pertid);
}
/**
* cfg80211_new_sta - notify userspace about station
*