Skip to contentSkip to conversation

ath9k: fix using sta->drv_priv before initializing it

PATCH In review Felix Fietkau 2 participants 3 messages Aug 2, 2016 – Aug 22, 2016 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k: fix using sta->drv_priv before initializing it

A station pointer can be passed to the driver on tx, before it has been marked as associated. Since ath9k_sta_state was initializing the entry too late, it resulted in some spurious crashes.

Fixes df3c6eb34da5 ("ath9k: Use sta_state() callback")
---
 drivers/net/wireless/ath/ath9k/main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +4 -4
index 7594650..a659e81 100644
@@ -1563,13 +1563,13 @@ static int ath9k_sta_state(struct ieee80211_hw *hw,
 	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
 	int ret = 0;
 
-	if (old_state == IEEE80211_STA_AUTH &&
-	    new_state == IEEE80211_STA_ASSOC) {
+	if (old_state == IEEE80211_STA_NOTEXIST &&
+	    new_state == IEEE80211_STA_NONE) {
 		ret = ath9k_sta_add(hw, vif, sta);
 		ath_dbg(common, CONFIG,
 			"Add station: %pM\n", sta->addr);
-	} else if (old_state == IEEE80211_STA_ASSOC &&
-		   new_state == IEEE80211_STA_AUTH) {
+	} else if (old_state == IEEE80211_STA_NONE &&
+		   new_state == IEEE80211_STA_NOTEXIST) {
 		ret = ath9k_sta_remove(hw, vif, sta);
 		ath_dbg(common, CONFIG,
 			"Remove station: %pM\n", sta->addr);
Signature · 1 line
2.8.4
#1 lore raw

Re: [4.8] ath9k: fix using sta->drv_priv before initializing it

Quoted 7 lines · Felix Fietkau

A station pointer can be passed to the driver on tx, before it has been marked as associated. Since ath9k_sta_state was initializing the entry too late, it resulted in some spurious crashes.

Fixes df3c6eb34da5 ("ath9k: Use sta_state() callback")

I'm planning to queue this for 4.8.

Signature · 2 lines
Sent by pwcli
https://patchwork.kernel.org/patch/9255463/
#2 lore raw

Re: [4.8] ath9k: fix using sta->drv_priv before initializing it

In reply to Felix Fietkau
Quoted 7 lines · Felix Fietkau

A station pointer can be passed to the driver on tx, before it has been marked as associated. Since ath9k_sta_state was initializing the entry too late, it resulted in some spurious crashes.

Fixes df3c6eb34da5 ("ath9k: Use sta_state() callback")

Thanks, 1 patch applied to ath-current branch of ath.git:

7711aaf08ad3 ath9k: fix using sta->drv_priv before initializing it

Signature · 2 lines
Sent by pwcli
https://patchwork.kernel.org/patch/9255463/