Skip to content

Commit 3e3a2b6

Browse files
oldiumjmberg-intel
authored andcommitted
wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush
This fixes WARN_ONs when using AP_VLANs after station removal. The flush call passed AP_VLAN vif to driver, but because these vifs are virtual and not registered with drivers, we need to translate to the correct AP vif first. Closes: openwrt/openwrt#12420 Fixes: 0b75a1b ("wifi: mac80211: flush queues on STA removal") Fixes: d00800a ("wifi: mac80211: add flush_sta method") Tested-by: Konstantin Demin <rockdrilla@gmail.com> Tested-by: Koen Vandeputte <koen.vandeputte@citymesh.com> Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com> Link: https://lore.kernel.org/r/20231104141333.3710-1-oldium.pro@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 71b5e40 commit 3e3a2b6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

net/mac80211/driver-ops.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
static inline struct ieee80211_sub_if_data *
2424
get_bss_sdata(struct ieee80211_sub_if_data *sdata)
2525
{
26-
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
26+
if (sdata && sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
2727
sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
2828
u.ap);
2929

@@ -695,11 +695,14 @@ static inline void drv_flush(struct ieee80211_local *local,
695695
struct ieee80211_sub_if_data *sdata,
696696
u32 queues, bool drop)
697697
{
698-
struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
698+
struct ieee80211_vif *vif;
699699

700700
might_sleep();
701701
lockdep_assert_wiphy(local->hw.wiphy);
702702

703+
sdata = get_bss_sdata(sdata);
704+
vif = sdata ? &sdata->vif : NULL;
705+
703706
if (sdata && !check_sdata_in_driver(sdata))
704707
return;
705708

@@ -716,6 +719,8 @@ static inline void drv_flush_sta(struct ieee80211_local *local,
716719
might_sleep();
717720
lockdep_assert_wiphy(local->hw.wiphy);
718721

722+
sdata = get_bss_sdata(sdata);
723+
719724
if (sdata && !check_sdata_in_driver(sdata))
720725
return;
721726

0 commit comments

Comments
 (0)