aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/wireless/ath/ath10k/htt_rx.c
diff options
context:
space:
mode:
authorClaire Chang <tientzu@chromium.org>2019-05-06 15:38:36 +0800
committerKalle Valo <kvalo@codeaurora.org>2019-06-25 15:55:03 +0300
commitef9cc0c443944fcf9dc7cdf2cfdf3975848bedc4 (patch)
tree06d34084f7f5866cfb25c2cfe1f339d436c04643 /drivers/net/wireless/ath/ath10k/htt_rx.c
parentath10k: change firmware file name for UTF mode of SDIO/USB (diff)
downloadwireguard-linux-ef9cc0c443944fcf9dc7cdf2cfdf3975848bedc4.tar.xz
wireguard-linux-ef9cc0c443944fcf9dc7cdf2cfdf3975848bedc4.zip
ath10k: acquire lock to fix lockdep's warning
Lockdep warns at lockdep_assert_held(&ar->data_lock) in ath10k_htt_rx_pn_check_replay_hl(). Acquire ar->data_lock before calling ath10k_htt_rx_pn_check_replay_hl() to fix it. Call trace: ath10k_htt_rx_pn_check_replay_hl+0x118/0x134 [ath10k_core] ath10k_htt_rx_proc_rx_ind_hl+0xd8/0x250 [ath10k_core] ath10k_htt_t2h_msg_handler+0x148/0xf30 [ath10k_core] ath10k_htt_htc_t2h_msg_handler+0x24/0x40 [ath10k_core] ath10k_sdio_irq_handler+0x374/0xaa4 [ath10k_sdio] Fixes: 130c77495708 ("ath10k: add PN replay protection for high latency devices") Signed-off-by: Claire Chang <tientzu@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/htt_rx.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/htt_rx.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 0c18c58de71d..e6d30155ba5c 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2158,6 +2158,7 @@ static bool ath10k_htt_rx_proc_rx_ind_hl(struct ath10k_htt *htt,
int num_mpdu_ranges;
size_t tot_hdr_len;
struct ieee80211_channel *ch;
+ bool pn_invalid;
peer_id = __le16_to_cpu(rx->hdr.peer_id);
@@ -2189,9 +2190,13 @@ static bool ath10k_htt_rx_proc_rx_ind_hl(struct ath10k_htt *htt,
goto err;
}
- if (check_pn_type == HTT_RX_PN_CHECK &&
- ath10k_htt_rx_pn_check_replay_hl(ar, peer, rx))
- goto err;
+ if (check_pn_type == HTT_RX_PN_CHECK) {
+ spin_lock_bh(&ar->data_lock);
+ pn_invalid = ath10k_htt_rx_pn_check_replay_hl(ar, peer, rx);
+ spin_unlock_bh(&ar->data_lock);
+ if (pn_invalid)
+ goto err;
+ }
/* Strip off all headers before the MAC header before delivery to
* mac80211