ath10k: make sure to not leak beacon dma mapping
authorMichal Kazior <michal.kazior@tieto.com>
Wed, 23 Apr 2014 16:30:05 +0000 (19:30 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 24 Apr 2014 06:22:29 +0000 (09:22 +0300)
If for some reason mac80211 wouldn't stop
beaconing gracefully and just removed interface of
a running AP/IBSS interface it was possible to
leak pending beacon DMA mapping. It's very
unlikely but better safe than sorry.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/mac.c

index 8385a7ad02acd626761d4e41ed8f4081d0a9042d..22e82398c45b402390a3e697e2baa563519c3ee7 100644 (file)
@@ -2771,6 +2771,9 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
 
        spin_lock_bh(&ar->data_lock);
        if (arvif->beacon) {
+               dma_unmap_single(arvif->ar->dev,
+                                ATH10K_SKB_CB(arvif->beacon)->paddr,
+                                arvif->beacon->len, DMA_TO_DEVICE);
                dev_kfree_skb_any(arvif->beacon);
                arvif->beacon = NULL;
        }