]> git.hungrycats.org Git - linux/commit
wifi: mac80211: fix channel evacuation logic
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 27 May 2026 19:51:45 +0000 (22:51 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 28 May 2026 07:50:23 +0000 (09:50 +0200)
commitf1a389fcc3f13a00c1202b0f63e073a2054184cc
tree319afa18c30bb1dd25686a7012bed9dfa1143c3d
parenta5b9ebd5c3f409ddfe1c15bdba361f904c16d719
wifi: mac80211: fix channel evacuation logic

When we try to assign a chanctx to a link, if
ieee80211_find_or_create_chanctx() failed, we try to evacuate a NAN
channel and call it again.

This logic is broken:
In case there are not enough chanctxs we will fail earlier,
when we check ieee80211_check_combinations().

To fix this, do the following in case ieee80211_check_combinations()
failed:
- check if there is a NAN channel that can be evacuated
- make ieee80211_check_combinations() not consider the chanctx of that NAN
  channel, so we pretend that it was already evacuated
- If now ieee80211_check_combinations() is successful, we know that it
  helped, and we can remove that NAN channel for real.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260527224745.5f7b10505145.I1712bc64f9eec9c99f05994208ad124624a29f1c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/chan.c
net/mac80211/ieee80211_i.h
net/mac80211/nan.c