[BUGFIX] wifi: mac80211: reserve chanctx during find
When searching for a chanctx for re-use, it's later adjusted and
assigned. It may also be that another one is already assigned to
the link in question, so unassign can also happen. In short, the
driver is called multiple times. During these callbacks, it may
thus change active links (on another interface), which then can
in turn cause the found chanctx (that's going to be reused) to
get removed and freed.
To avoid this, temporarily assign it to the reserved chanctx and
track the link that wants to use it in the reserved_links list.
This causes the ieee80211_chanctx_refcount() to be increased by
one during these operations, thus avoiding the free.
type=bugfix
fixes=unknown
ticket=jira:WIFI-404852
Change-Id: I0b247dbc0cd937ae6367bc0fc7e8d156b5d5f9b1
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/104078
automatic-review: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
tested: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
Tested-by: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
(cherry picked from commit 6051d8e3cec3864214adced9d6be22d45283d025)
Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/103722
Reviewed-by: Golan Ben Ami <golan.ben.ami@intel.com>
PerCI-Ready: Golan Ben Ami <golan.ben.ami@intel.com>
x-iwlwifi-stack-dev: 0ac16c47574aee7d132ebb518aa438c903cc2bf4
2 files changed