aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-10-20 09:38:28 +0200
committerJohannes Berg <johannes.berg@intel.com>2023-10-23 12:29:54 +0200
commite5dfb9416b6eecb19a3ee0277b0432aa0f9b9f7c (patch)
tree076f06bac0c9997f69157ed9c978b319c5deafe1 /net/mac80211
parent8e4687f6061ec00d16b06cb2ed6d2593cae19c46 (diff)
downloadlinux-e5dfb9416b6eecb19a3ee0277b0432aa0f9b9f7c.tar.gz
wifi: mac80211: fix another key installation error path
Due to overlapping changes and merges, another error path ended up broken. Fix this one as well. Reported-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/key.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index e0ff3a753e15d..af74d7f9d94d0 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -881,8 +881,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->hw.wiphy->mtx));
- if (!link_sta)
- return -ENOLINK;
+ if (!link_sta) {
+ ret = -ENOLINK;
+ goto out;
+ }
}
old_key = wiphy_dereference(sdata->local->hw.wiphy,