kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: mac80211: Unlock on error path in ieee80211_key_link()
@ 2022-08-29  8:41 Dan Carpenter
  2022-08-29  8:53 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-08-29  8:41 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Ilan Peer, linux-wireless, kernel-janitors

Unlock before returning on this error path.

Fixes: ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 net/mac80211/key.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 86aac87e0211..d89ec93b243b 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -865,8 +865,10 @@ int ieee80211_key_link(struct ieee80211_key *key,
 		if (link_id >= 0) {
 			link_sta = rcu_dereference_protected(sta->link[link_id],
 							     lockdep_is_held(&sta->local->sta_mtx));
-			if (!link_sta)
-				return -ENOLINK;
+			if (!link_sta) {
+				ret = -ENOLINK;
+				goto out;
+			}
 		}
 
 		old_key = key_mtx_dereference(sdata->local, link_sta->gtk[idx]);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wifi: mac80211: Unlock on error path in ieee80211_key_link()
  2022-08-29  8:41 [PATCH] wifi: mac80211: Unlock on error path in ieee80211_key_link() Dan Carpenter
@ 2022-08-29  8:53 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2022-08-29  8:53 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Ilan Peer, linux-wireless, kernel-janitors

On Mon, Aug 29, 2022 at 11:41:41AM +0300, Dan Carpenter wrote:
> Unlock before returning on this error path.
> 

Never mind.  I see that Sun Ke already sent this.  I need to make
checking lore a standard part of my QC process instead of only for
uninitialized variable bugs...

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-29  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29  8:41 [PATCH] wifi: mac80211: Unlock on error path in ieee80211_key_link() Dan Carpenter
2022-08-29  8:53 ` Dan Carpenter

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).