mac80211: fix a memory leak on sta rate selection table
authorFelix Fietkau <nbd@openwrt.org>
Tue, 27 May 2014 20:33:57 +0000 (22:33 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 28 May 2014 14:22:41 +0000 (16:22 +0200)
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@openwrt.org>
Reported-by: Christophe Prévotaux <cprevotaux@nltinc.com>
Fixes: 0d528d85c519 ("mac80211: improve the rate control API")
Cc: stable@vger.kernel.org # v3.10+
[add commit log entry, remove pointless NULL check]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/sta_info.c

index c34a5f97abc74ff8791b20676130dd1ce5d55c0c..be9120fb844810487c3e07cc84f4e42a0b1387a7 100644 (file)
@@ -240,6 +240,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);
 }