diff options
| author | Sarika Sharma <quic_sarishar@quicinc.com> | 2025-05-28 11:14:15 +0530 |
|---|---|---|
| committer | Johannes Berg <johannes.berg@intel.com> | 2025-06-24 15:19:26 +0200 |
| commit | 49e47223ecc4af0bd15b5267184d46b3654d520b (patch) | |
| tree | f92c662f7c024021d601bef853d98e1dd9ed56c0 /include/net | |
| parent | wifi: cfg80211: add statistics for providing overview for MLO station (diff) | |
| download | linux-49e47223ecc4af0bd15b5267184d46b3654d520b.tar.gz linux-49e47223ecc4af0bd15b5267184d46b3654d520b.zip | |
wifi: cfg80211: allocate memory for link_station info structure
Currently, station_info structure is passed to fill station statistics
from mac80211/drivers. After NL message send to user space for requested
station statistics, memory for station statistics is freed in cfg80211.
Therefore, memory allocation/free for link station statistics should
also happen in cfg80211 only.
Hence, allocate the memory for link_station structure for all
possible links and free in cfg80211_sinfo_release_content().
Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
Link: https://patch.msgid.link/20250528054420.3050133-6-quic_sarishar@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/cfg80211.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index b008357cac03..7bf0c97d2ab1 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -8577,6 +8577,13 @@ int cfg80211_sinfo_alloc_tid_stats(struct station_info *sinfo, gfp_t gfp); static inline void cfg80211_sinfo_release_content(struct station_info *sinfo) { kfree(sinfo->pertid); + + for (int link_id = 0; link_id < ARRAY_SIZE(sinfo->links); link_id++) { + if (sinfo->links[link_id]) { + kfree(sinfo->links[link_id]->pertid); + kfree(sinfo->links[link_id]); + } + } } /** |
