From 43473cc1b0dcfac394378f77b12b54decf5db460 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 15 Jul 2026 21:33:38 +0300 Subject: [PATCH] wifi: mac80211: fix monitor min_def bandwidth Due to reshuffling, the min_def is no longer calculated taking a newly created monitor interface into account as link->conf->chanctx_conf is only assigned after the new bandwidth has been calculated. To handle this, rsvd_for is assigned, but the monitor code didn't handle that. Fix this by checking rsvd_for for monitor explicitly. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20260715213312.9fe95421689d.I24e08f95e97deb46c6393ee732057d63e6436a2e@changeid Signed-off-by: Johannes Berg --- net/mac80211/chan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index 5152b84a3357..75bb204ad743 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -607,10 +607,12 @@ ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local, max_bw = max(max_bw, width); } - if (!rsvd_for || - rsvd_for->sdata == rcu_access_pointer(local->monitor_sdata)) + if (!rsvd_for) goto check_monitor; + if (rsvd_for->sdata == rcu_access_pointer(local->monitor_sdata)) + return max(max_bw, ctx->conf.def.width); + /* Consider the link for which this chanctx is reserved/going to be assigned */ width = ieee80211_get_width_of_link(rsvd_for); max_bw = max(max_bw, width);