From: Johannes Berg Date: Wed, 9 Jul 2025 20:37:53 +0000 (+0300) Subject: wifi: mac80211: don't unreserve never reserved chanctx X-Git-Tag: v6.16.2~328 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f03c9e30bb26153bfb09c8425856b63cd3ce16b4;p=thirdparty%2Fkernel%2Fstable.git wifi: mac80211: don't unreserve never reserved chanctx [ 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 Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20250709233537.022192f4b1ae.Ib58156ac13e674a9f4d714735be0764a244c0aae@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 42bb996157e9d..60f943f133ac2 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -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);