From: Eliad Peller Date: Thu, 29 Dec 2011 12:41:39 +0000 (+0200) Subject: mac80211: check sta_apply_parameters() return value X-Git-Tag: firefly_0821_release~3680^2~3338^2~112^2~467 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=35b88623692f7ffbfdf16e4c2358784a060c20ed;p=firefly-linux-kernel-4.4.55.git mac80211: check sta_apply_parameters() return value Bail out if sta_apply_parameters() returns an error. Signed-off-by: Eliad Peller Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 296620d6ca0c..d86730fe75c8 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1001,6 +1001,7 @@ static int ieee80211_change_station(struct wiphy *wiphy, struct ieee80211_local *local = wiphy_priv(wiphy); struct sta_info *sta; struct ieee80211_sub_if_data *vlansdata; + int err; mutex_lock(&local->sta_mtx); @@ -1040,7 +1041,11 @@ static int ieee80211_change_station(struct wiphy *wiphy, ieee80211_send_layer2_update(sta); } - sta_apply_parameters(local, sta, params); + err = sta_apply_parameters(local, sta, params); + if (err) { + mutex_unlock(&local->sta_mtx); + return err; + } if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) && params->supported_rates) rate_control_rate_init(sta);