diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index ed4fef32b394..08384dbf426c 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1104,9 +1104,6 @@ static void ieee80211_chswitch_work(struct work_struct *work) goto out; } - /* XXX: shouldn't really modify cfg80211-owned data! */ - ifmgd->associated->channel = sdata->csa_chandef.chan; - ifmgd->csa_waiting_bcn = true; ieee80211_sta_reset_beacon_monitor(sdata); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 81013490a99f..1968998e6c6c 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -12788,6 +12788,11 @@ void cfg80211_ch_switch_notify(struct net_device *dev, wdev->chandef = *chandef; wdev->preset_chandef = *chandef; + + if (wdev->iftype == NL80211_IFTYPE_STATION && + !WARN_ON(!wdev->current_bss)) + wdev->current_bss->pub.channel = chandef->chan; + nl80211_ch_switch_notify(rdev, dev, chandef, GFP_KERNEL, NL80211_CMD_CH_SWITCH_NOTIFY, 0); }