mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
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: df3c6eb34d
("ath9k: Use sta_state() callback")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
parent
05860bed49
commit
7711aaf08a
1 changed files with 4 additions and 4 deletions
|
@ -1564,13 +1564,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);
|
||||
|
|
Loading…
Add table
Reference in a new issue