From: Johannes Berg Date: Sun, 4 Jun 2023 09:11:20 +0000 (+0300) Subject: wifi: mac80211: recalc min chandef for new STA links X-Git-Tag: Ubuntu-6.2.0-36.36~1194 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8cfb5085c00d85932054ef6f7759fea990685a7a;p=mirror_ubuntu-kernels.git wifi: mac80211: recalc min chandef for new STA links BugLink: https://bugs.launchpad.net/bugs/2034469 [ Upstream commit ba7af2654e3b7b810c750b3c6106f6f20b81cc88 ] When adding a new link to a station, this needs to cause a recalculation of the minimum chandef since otherwise we can have a higher bandwidth station connected on that link than the link is operating at. Do the appropriate recalc. Fixes: cb71f1d136a6 ("wifi: mac80211: add sta link addition/removal") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20230604120651.377adf3c789a.I91bf28f399e16e6ac1f83bacd1029a698b4e6685@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Kamal Mostafa Signed-off-by: Stefan Bader --- diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 39731ef51e03..1643a0a3103b 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2891,6 +2891,8 @@ int ieee80211_sta_activate_link(struct sta_info *sta, unsigned int link_id) if (!test_sta_flag(sta, WLAN_STA_INSERTED)) goto hash; + ieee80211_recalc_min_chandef(sdata, link_id); + /* Ensure the values are updated for the driver, * redone by sta_remove_link on failure. */