Skip to content

Commit

Permalink
wifi: mac80211: fix error path key leak
Browse files Browse the repository at this point in the history
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: d097ae0 ("wifi: mac80211: fix potential key leak")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Oct 11, 2023
1 parent 91d20ab commit 02e0e42
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 02e0e42

Please sign in to comment.