diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-05-26 12:46:03 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-05-27 12:28:14 +0300 |
commit | 911e6c0d8deeeaf526e67bde47bb6a40f0fd46aa (patch) | |
tree | 70de71343be57a67a4d8c3b39ae39d32f615aa46 /drivers/net/wireless | |
parent | bca7bafbe2b75ed31cc6943b81218ea0f8a13686 (diff) | |
download | op-kernel-dev-911e6c0d8deeeaf526e67bde47bb6a40f0fd46aa.zip op-kernel-dev-911e6c0d8deeeaf526e67bde47bb6a40f0fd46aa.tar.gz |
ath10k: protect wep tx key setup
All configuration sequences should be protected
with conf_mutex to avoid concurrent/conflicting
requests.
This should make sure that wep tx key setup is not
performed while hw is restarted (at least).
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 8ad03d5..f21d60f 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1891,8 +1891,13 @@ static void ath10k_tx_wep_key_work(struct work_struct *work) wep_key_work); int ret, keyidx = arvif->def_wep_key_newidx; + mutex_lock(&arvif->ar->conf_mutex); + + if (arvif->ar->state != ATH10K_STATE_ON) + goto unlock; + if (arvif->def_wep_key_idx == keyidx) - return; + goto unlock; ath10k_dbg(ATH10K_DBG_MAC, "mac vdev %d set keyidx %d\n", arvif->vdev_id, keyidx); @@ -1905,10 +1910,13 @@ static void ath10k_tx_wep_key_work(struct work_struct *work) ath10k_warn("failed to update wep key index for vdev %d: %d\n", arvif->vdev_id, ret); - return; + goto unlock; } arvif->def_wep_key_idx = keyidx; + +unlock: + mutex_unlock(&arvif->ar->conf_mutex); } static void ath10k_tx_h_update_wep_key(struct sk_buff *skb) |