]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mac80211: don't unreserve never reserved chanctx
authorJohannes Berg <johannes.berg@intel.com>
Wed, 9 Jul 2025 20:37:53 +0000 (23:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:08 +0000 (18:41 +0200)
[ Upstream commit a6d521bafcb290294128a51b13dbf4baae5748fc ]

If a link has no chanctx, indicating it is an inactive link
that we tracked CSA for, then attempting to unreserve the
reserved chanctx will throw a warning and fail, since there
never was a reserved chanctx. Skip the unreserve.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250709233537.022192f4b1ae.Ib58156ac13e674a9f4d714735be0764a244c0aae@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/mlme.c

index 42bb996157e9d6f49c3ef87ae4509e76945baad9..60f943f133ac21e01aaf55a67c007f875497c236 100644 (file)
@@ -2535,7 +2535,8 @@ ieee80211_sta_abort_chanswitch(struct ieee80211_link_data *link)
        if (!local->ops->abort_channel_switch)
                return;
 
-       ieee80211_link_unreserve_chanctx(link);
+       if (rcu_access_pointer(link->conf->chanctx_conf))
+               ieee80211_link_unreserve_chanctx(link);
 
        ieee80211_vif_unblock_queues_csa(sdata);