Skip to content

Commit 33483a6

Browse files
Wei Yongjunjmberg-intel
authored andcommitted
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: [email protected] Fixes: fc107a9 ("mac80211: Helper function for marking STA authenticated") Signed-off-by: Wei Yongjun <[email protected]> [use result variable/label instead of duplicating] Signed-off-by: Johannes Berg <[email protected]>
1 parent 05cc09d commit 33483a6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

net/mac80211/mlme.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,6 +2766,7 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
27662766
{
27672767
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
27682768
struct sta_info *sta;
2769+
bool result = true;
27692770

27702771
sdata_info(sdata, "authenticated\n");
27712772
ifmgd->auth_data->done = true;
@@ -2778,15 +2779,18 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
27782779
sta = sta_info_get(sdata, bssid);
27792780
if (!sta) {
27802781
WARN_ONCE(1, "%s: STA %pM not found", sdata->name, bssid);
2781-
return false;
2782+
result = false;
2783+
goto out;
27822784
}
27832785
if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) {
27842786
sdata_info(sdata, "failed moving %pM to auth\n", bssid);
2785-
return false;
2787+
result = false;
2788+
goto out;
27862789
}
2787-
mutex_unlock(&sdata->local->sta_mtx);
27882790

2789-
return true;
2791+
out:
2792+
mutex_unlock(&sdata->local->sta_mtx);
2793+
return result;
27902794
}
27912795

27922796
static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,

0 commit comments

Comments
 (0)