Skip to contentSkip to conversation

wifi: mac80211: fix error path key leak

PATCH New Johannes Berg 1 participant 1 message Oct 5, 2023 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 wifi: mac80211: fix error path key leak

From: Johannes Berg <[email protected]>

In the previous key leak fix for the other error
paths, I meant to unify all of them to the same
place, but used the wrong label, which I noticed
when doing the merge into wireless-next. Fix it.

Fixes d097ae01ebd4 ("wifi: mac80211: fix potential key leak")
---
 net/mac80211/key.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/mac80211/key.c +1 -2
index 0665ff5e456e..a2db0585dce0 100644
@@ -912,7 +912,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
 	 */
 	if (ieee80211_key_identical(sdata, old_key, key)) {
 		ret = -EALREADY;
-		goto unlock;
+		goto out;
 	}
 
 	key->local = sdata->local;
@@ -940,7 +940,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
 
  out:
 	ieee80211_key_free_unused(key);
- unlock:
 	mutex_unlock(&sdata->local->key_mtx);
 
 	return ret;
Signature · 1 line
2.41.0