summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-05-18 12:40:44 +0300
committerJohannes Berg <johannes.berg@intel.com>2018-05-18 13:37:55 +0300
commit7ea3e110f2f8ba23f330c2f702f556acd539bcb8 (patch)
tree8619eac094435ad790ee411991a3a4bd8f69f5b4 /include
parent0fdf1493b41eb64fc7e8c8e1b8830a4bd8c4bbca (diff)
downloadlinux-7ea3e110f2f8ba23f330c2f702f556acd539bcb8.tar.xz
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: 8689c051a201 ("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>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 8984d24d68b7..11a218445448 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5711,6 +5711,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
*
* @dev: the netdev