From: Eytan Lifshitz Date: Thu, 6 Feb 2014 19:01:32 +0000 (+0200) Subject: mac80211: fix memory leak X-Git-Tag: accepted/tizen/common/20141203.182822~411^2~21^2^2~6^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c368ddaa9ad79fdffde4756804321feba6725c75;p=platform%2Fkernel%2Flinux-arm64.git mac80211: fix memory leak 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 Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index fc1d824..57d5482 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3753,6 +3753,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);