[PATCH 3.13 068/198] mac80211: fix a memory leak on sta rate selection table

Kamal Mostafa kamal at canonical.com
Tue Jul 15 21:28:58 UTC 2014


3.13.11.5 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Felix Fietkau <nbd at openwrt.org>

commit 53d045258ee2e38b1e882617cb0799a04d05f5fa upstream.

If the rate control algorithm uses a selection table, it
is leaked when the station is destroyed - fix that.

Signed-off-by: Felix Fietkau <nbd at openwrt.org>
Reported-by: Christophe Prévotaux <cprevotaux at nltinc.com>
Fixes: 0d528d85c519 ("mac80211: improve the rate control API")
[add commit log entry, remove pointless NULL check]
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 net/mac80211/sta_info.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f92e221..ae0c132 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -271,6 +271,7 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
 
 	sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
 
+	kfree(rcu_dereference_raw(sta->sta.rates));
 	kfree(sta);
 }
 
-- 
1.9.1





More information about the kernel-team mailing list