Skip to content

Commit

Permalink
wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush
Browse files Browse the repository at this point in the history
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: https://github.com/openwrt/openwrt/issues/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>
  • Loading branch information
Oldřich Jedlička authored and Johannes Berg committed Nov 24, 2023
1 parent 71b5e40 commit 3e3a2b6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions net/mac80211/driver-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
static inline struct ieee80211_sub_if_data *
get_bss_sdata(struct ieee80211_sub_if_data *sdata)
{
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
if (sdata && sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
u.ap);

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

might_sleep();
lockdep_assert_wiphy(local->hw.wiphy);

sdata = get_bss_sdata(sdata);
vif = sdata ? &sdata->vif : NULL;

if (sdata && !check_sdata_in_driver(sdata))
return;

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

sdata = get_bss_sdata(sdata);

if (sdata && !check_sdata_in_driver(sdata))
return;

Expand Down

0 comments on commit 3e3a2b6

Please sign in to comment.