From: Johannes Berg 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. Fixes: 3f451a2cf56c ("wifi: mac80211: use for_each_chanctx_user_* in one more place") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- 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); -- 2.34.1