summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorMiaoqing Pan <miaoqing@codeaurora.org>2017-06-27 17:31:55 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2017-06-28 19:54:43 +0300
commitf23cdfb3fe8f6e3502b8aebb819edf5669c1d802 (patch)
treeebafab2c4a03b99e7fc29f76e1231f5bc7bb06a3 /drivers/net/wireless/ath/ath9k
parent473becac4b310dd720a0f5e07ce149a09467f1a4 (diff)
downloadop-kernel-dev-f23cdfb3fe8f6e3502b8aebb819edf5669c1d802.zip
op-kernel-dev-f23cdfb3fe8f6e3502b8aebb819edf5669c1d802.tar.gz
ath9k: Use mutex_lock to avoid potential race in start/stop rng
Move ath9k_rng_stop/ath9k_rng_start pair into critical section, use mutex_lock to void potential race accessing. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 9e65d14..8b4ac7f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -731,12 +731,12 @@ static int ath9k_start(struct ieee80211_hw *hw)
spin_unlock_bh(&sc->sc_pcu_lock);
+ ath9k_rng_start(sc);
+
mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
- ath9k_rng_start(sc);
-
return 0;
}
@@ -826,10 +826,10 @@ static void ath9k_stop(struct ieee80211_hw *hw)
ath9k_deinit_channel_context(sc);
- ath9k_rng_stop(sc);
-
mutex_lock(&sc->mutex);
+ ath9k_rng_stop(sc);
+
ath_cancel_work(sc);
if (test_bit(ATH_OP_INVALID, &common->op_flags)) {
OpenPOWER on IntegriCloud