Commit 76f90024 authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo

ath10k: fix sta_rc_update for non-ap iftype

The arsta structure wasn't initialized for
non-ap interfaces. This should fix related
warnings/crashes.
Reported-By: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent d960c369
...@@ -3179,6 +3179,13 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ...@@ -3179,6 +3179,13 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
int max_num_peers; int max_num_peers;
int ret = 0; int ret = 0;
if (old_state == IEEE80211_STA_NOTEXIST &&
new_state == IEEE80211_STA_NONE) {
memset(arsta, 0, sizeof(*arsta));
arsta->arvif = arvif;
INIT_WORK(&arsta->update_wk, ath10k_sta_rc_update_wk);
}
/* cancel must be done outside the mutex to avoid deadlock */ /* cancel must be done outside the mutex to avoid deadlock */
if ((old_state == IEEE80211_STA_NONE && if ((old_state == IEEE80211_STA_NONE &&
new_state == IEEE80211_STA_NOTEXIST)) new_state == IEEE80211_STA_NOTEXIST))
...@@ -3208,10 +3215,6 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, ...@@ -3208,10 +3215,6 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
"mac vdev %d peer create %pM (new sta) num_peers %d\n", "mac vdev %d peer create %pM (new sta) num_peers %d\n",
arvif->vdev_id, sta->addr, ar->num_peers); arvif->vdev_id, sta->addr, ar->num_peers);
memset(arsta, 0, sizeof(*arsta));
arsta->arvif = arvif;
INIT_WORK(&arsta->update_wk, ath10k_sta_rc_update_wk);
ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr); ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr);
if (ret) if (ret)
ath10k_warn("Failed to add peer %pM for vdev %d when adding a new sta: %i\n", ath10k_warn("Failed to add peer %pM for vdev %d when adding a new sta: %i\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment