summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-10-15 22:35:30 -0400
committerJohannes Berg <johannes.berg@intel.com>2018-11-09 02:54:17 -0500
commit33483a6b88e4c4c3fc50178b185da52c55288b95 (patch)
treed07a757644fa37abbf1fc8808a9b66417bc1c93d /net
parent05cc09de4c017663a217630682041066f2f9a5cd (diff)
mac80211: fix missing unlock on error in ieee80211_mark_sta_auth()
Add the missing unlock before return from function ieee80211_mark_sta_auth() in the error handling case. Cc: stable@vger.kernel.org Fixes: fc107a933071 ("mac80211: Helper function for marking STA authenticated") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> [use result variable/label instead of duplicating] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d2bc8d57c87e..bcf5ffc1567a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2766,6 +2766,7 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
2766{ 2766{
2767 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 2767 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2768 struct sta_info *sta; 2768 struct sta_info *sta;
2769 bool result = true;
2769 2770
2770 sdata_info(sdata, "authenticated\n"); 2771 sdata_info(sdata, "authenticated\n");
2771 ifmgd->auth_data->done = true; 2772 ifmgd->auth_data->done = true;
@@ -2778,15 +2779,18 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
2778 sta = sta_info_get(sdata, bssid); 2779 sta = sta_info_get(sdata, bssid);
2779 if (!sta) { 2780 if (!sta) {
2780 WARN_ONCE(1, "%s: STA %pM not found", sdata->name, bssid); 2781 WARN_ONCE(1, "%s: STA %pM not found", sdata->name, bssid);
2781 return false; 2782 result = false;
2783 goto out;
2782 } 2784 }
2783 if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) { 2785 if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) {
2784 sdata_info(sdata, "failed moving %pM to auth\n", bssid); 2786 sdata_info(sdata, "failed moving %pM to auth\n", bssid);
2785 return false; 2787 result = false;
2788 goto out;
2786 } 2789 }
2787 mutex_unlock(&sdata->local->sta_mtx);
2788 2790
2789 return true; 2791out:
2792 mutex_unlock(&sdata->local->sta_mtx);
2793 return result;
2790} 2794}
2791 2795
2792static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata, 2796static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,