summaryrefslogtreecommitdiff
path: root/net/mac80211/driver-ops.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2025-01-02 16:20:06 +0200
committerJohannes Berg <johannes.berg@intel.com>2025-01-13 15:34:09 +0100
commitaa3ce3f8fafa0b8fb062f28024855ea8cb3f3450 (patch)
tree2afa8140879eb1ddb259caf3b0dbe06b0e3494ad /net/mac80211/driver-ops.h
parent6bd9a087c8035626e7bfb6b678c9e036b8b26038 (diff)
downloadlinux-aa3ce3f8fafa0b8fb062f28024855ea8cb3f3450.tar.gz
linux-aa3ce3f8fafa0b8fb062f28024855ea8cb3f3450.tar.bz2
linux-aa3ce3f8fafa0b8fb062f28024855ea8cb3f3450.zip
wifi: mac80211: don't flush non-uploaded STAs
If STA state is pre-moved to AUTHORIZED (such as in IBSS scenarios) and insertion fails, the station is freed. In this case, the driver never knew about the station, so trying to flush it is unexpected and may crash. Check if the sta was uploaded to the driver before and fix this. Fixes: d00800a289c9 ("wifi: mac80211: add flush_sta method") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250102161730.e3d10970a7c7.I491bbcccc46f835ade07df0640a75f6ed92f20a3@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r--net/mac80211/driver-ops.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index c64531e0a60e..5acecc7bd4a9 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -724,6 +724,9 @@ static inline void drv_flush_sta(struct ieee80211_local *local,
if (sdata && !check_sdata_in_driver(sdata))
return;
+ if (!sta->uploaded)
+ return;
+
trace_drv_flush_sta(local, sdata, &sta->sta);
if (local->ops->flush_sta)
local->ops->flush_sta(&local->hw, &sdata->vif, &sta->sta);