Skip to contentSkip to conversation

wifi: mac80211: Unlock on error path in ieee80211_key_link()

PATCH In review Dan Carpenter 1 participant 2 messages Aug 29, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mac80211: Unlock on error path in ieee80211_key_link()

Unlock before returning on this error path.

Fixes ccdde7c74ffd ("wifi: mac80211: properly implement MLO key handling")
---
 net/mac80211/key.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/mac80211/key.c +4 -2
index 86aac87e0211..d89ec93b243b 100644
@@ -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]);
Signature · 1 line
2.35.1
#1 lore raw
Quoted 2 lines · Dan Carpenter

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