linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyongjun1@huawei.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	Jouni Malinen <jouni@codeaurora.org>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
	<linux-wireless@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>
Subject: [PATCH net-next] mac80211: fix missing unlock on error in ieee80211_mark_sta_auth()
Date: Tue, 16 Oct 2018 02:35:30 +0000	[thread overview]
Message-ID: <1539657330-35956-1-git-send-email-weiyongjun1@huawei.com> (raw)

Add the missing unlock before return from function
ieee80211_mark_sta_auth() in the error handling case.

Fixes: fc107a933071 ("mac80211: Helper function for marking STA authenticated")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 net/mac80211/mlme.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d2bc8d5..755ca4d 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2778,10 +2778,12 @@ static bool ieee80211_mark_sta_auth(struct ieee80211_sub_if_data *sdata,
 	sta = sta_info_get(sdata, bssid);
 	if (!sta) {
 		WARN_ONCE(1, "%s: STA %pM not found", sdata->name, bssid);
+		mutex_unlock(&sdata->local->sta_mtx);
 		return false;
 	}
 	if (sta_info_move_state(sta, IEEE80211_STA_AUTH)) {
 		sdata_info(sdata, "failed moving %pM to auth\n", bssid);
+		mutex_unlock(&sdata->local->sta_mtx);
 		return false;
 	}
 	mutex_unlock(&sdata->local->sta_mtx);


                 reply	other threads:[~2018-10-16  2:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1539657330-35956-1-git-send-email-weiyongjun1@huawei.com \
    --to=weiyongjun1@huawei.com \
    --cc=johannes@sipsolutions.net \
    --cc=jouni@codeaurora.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).