Skip to content

Commit aa3ce3f

Browse files
committed
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: d00800a ("wifi: mac80211: add flush_sta method") Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250102161730.e3d10970a7c7.I491bbcccc46f835ade07df0640a75f6ed92f20a3@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 6bd9a08 commit aa3ce3f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mac80211/driver-ops.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,9 @@ static inline void drv_flush_sta(struct ieee80211_local *local,
724724
if (sdata && !check_sdata_in_driver(sdata))
725725
return;
726726

727+
if (!sta->uploaded)
728+
return;
729+
727730
trace_drv_flush_sta(local, sdata, &sta->sta);
728731
if (local->ops->flush_sta)
729732
local->ops->flush_sta(&local->hw, &sdata->vif, &sta->sta);

0 commit comments

Comments
 (0)