summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2014-09-27 01:40:22 +0400
committerJohn W. Linville <linville@tuxdriver.com>2014-09-30 21:17:14 +0400
commit7fe3b3abb5da3a105d87640db693c41259138294 (patch)
tree74f78aaa94eaab6dad0278bfee9a88950523674b /drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
parenta0196d111707d8b79196a40295f3935c5fa339eb (diff)
downloadlinux-7fe3b3abb5da3a105d87640db693c41259138294.tar.xz
rtlwifi: rtl8188ee: rtl8821ae: Fix a queue locking problem
The code fails to lock the skb queue, which leads to a number of problems. This patch also fixes a Sparse warning about using a memset of 1 byte. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: troy_tan@realsil.com.cn Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8188ee/hw.c')
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8188ee/hw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
index f74b7fb531c2..f2b9713c456e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
@@ -89,7 +89,9 @@ static void _rtl88ee_return_beacon_queue_skb(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE];
+ unsigned long flags;
+ spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags);
while (skb_queue_len(&ring->queue)) {
struct rtl_tx_desc *entry = &ring->desc[ring->idx];
struct sk_buff *skb = __skb_dequeue(&ring->queue);
@@ -101,6 +103,7 @@ static void _rtl88ee_return_beacon_queue_skb(struct ieee80211_hw *hw)
kfree_skb(skb);
ring->idx = (ring->idx + 1) % ring->entries;
}
+ spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);
}
static void _rtl88ee_disable_bcn_sub_func(struct ieee80211_hw *hw)