Commit 7c13844c authored by Sun Ke's avatar Sun Ke Committed by Johannes Berg

wifi: mac80211: fix potential deadlock in ieee80211_key_link()

Add the missing unlock before return in the error handling case.

Fixes: ccdde7c7 ("wifi: mac80211: properly implement MLO key handling")
Signed-off-by: default avatarSun Ke <sunke32@huawei.com>
Link: https://lore.kernel.org/r/20220827022452.823381-1-sunke32@huawei.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 643952f3
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment