Skip to contentSkip to conversation

wifi: mac80211: only call drv_sta_rc_update for uploaded stations

PATCH New Felix Fietkau 1 participant 1 message Feb 21, 2024 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mac80211: only call drv_sta_rc_update for uploaded stations

When a station has not been uploaded yet, receiving SMPS or channel width notification action frames can lead to rate_control_rate_update calling drv_sta_rc_update with uninitialized driver private data.
Fix this by adding a missing check for sta->uploaded.

---
 net/mac80211/rate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/rate.c +2 -1
index d5ea5f5bcf3a..9d33fd2377c8 100644
@@ -119,7 +119,8 @@ void rate_control_rate_update(struct ieee80211_local *local,
 		rcu_read_unlock();
 	}
 
-	drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
+	if (sta->uploaded)
+		drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
 }
 
 int ieee80211_rate_control_register(const struct rate_control_ops *ops)
Signature · 1 line
2.43.0