linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix a memory leak on sta rate selection table
@ 2014-05-23 17:29 Felix Fietkau
  2014-05-27 16:34 ` Ben Greear
  2014-05-27 17:55 ` Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Felix Fietkau @ 2014-05-23 17:29 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, cprevotaux

Cc: stable@vger.kernel.org
Reported-by: Christophe Prévotaux <cprevotaux@nltinc.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 net/mac80211/sta_info.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 632d372..8b42f49 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -227,6 +227,7 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
  */
 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
 {
+	struct ieee80211_sta_rates *rates;
 	int i;
 
 	if (sta->rate_ctrl)
@@ -238,6 +239,10 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
 		kfree(sta->tx_lat);
 	}
 
+	rates = rcu_dereference_protected(sta->sta.rates, true);
+	if (rates)
+		kfree(rates);
+
 	sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
 
 	kfree(sta);
-- 
1.8.5.2 (Apple Git-48)


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-27 20:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 17:29 [PATCH] mac80211: fix a memory leak on sta rate selection table Felix Fietkau
2014-05-27 16:34 ` Ben Greear
2014-05-27 16:40   ` Christophe Prevotaux
2014-05-27 17:01     ` Ben Greear
2014-05-27 20:28       ` Felix Fietkau
2014-05-27 17:55 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).