diff mbox

mac80211: fix memory leak

Message ID 1391713292-7378-1-git-send-email-egrumbach@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Emmanuel Grumbach Feb. 6, 2014, 7:01 p.m. UTC
From: Eytan Lifshitz <eytan.lifshitz@intel.com>

In case ieee80211_prep_connection() fails to dereference
sdata->vif.chanctx_conf, the function returns and doesn't
free new_sta. fixed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
---
 net/mac80211/mlme.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Johannes Berg Feb. 11, 2014, 11:59 a.m. UTC | #1
On Thu, 2014-02-06 at 21:01 +0200, Emmanuel Grumbach wrote:
> From: Eytan Lifshitz <eytan.lifshitz@intel.com>
> 
> In case ieee80211_prep_connection() fails to dereference
> sdata->vif.chanctx_conf, the function returns and doesn't
> free new_sta. fixed.

Applied.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b640cd6..da4b09e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3792,6 +3792,7 @@  static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
 		chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
 		if (WARN_ON(!chanctx_conf)) {
 			rcu_read_unlock();
+			sta_info_free(local, new_sta);
 			return -EINVAL;
 		}
 		rate_flags = ieee80211_chandef_rate_flags(&chanctx_conf->def);