Skip to contentSkip to conversation

mac80211: fix a memory leak on sta rate selection table

PATCH Applied Felix Fietkau 2 participants 2 messages May 27, 2014 – May 28, 2014 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mac80211: fix a memory leak on sta rate selection table

---
 net/mac80211/sta_info.c | 5 +++++
 1 file changed, 5 insertions(+)
net/mac80211/sta_info.c +5 -0
index 632d372..3f26740 100644
@@ -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_raw(sta->sta.rates);
+	if (rates)
+		kfree(rates);
+
 	sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
 
 	kfree(sta);
Signature · 1 line
1.8.5.2 (Apple Git-48)