Skip to content

Commit

Permalink
wifi: mac80211: fix another key installation error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Oct 23, 2023
1 parent 8e4687f commit e5dfb94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e5dfb94

Please sign in to comment.