[PATCH 2/4] ath10k: make sure to not use invalid beacon pointer

Michal Kazior michal.kazior at tieto.com
Wed Apr 9 03:01:23 PDT 2014


If DMA mapping of next beacon failed it was
possible for next SWBA to access a pointer that
was already unmapped and freed. This could cause
memory corruption.

Signed-off-by: Michal Kazior <michal.kazior at tieto.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index d4b48ef..35c7d52 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1441,6 +1441,8 @@ static void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 			dev_kfree_skb_any(arvif->beacon);
 		}
 
+		arvif->beacon = NULL;
+
 		ATH10K_SKB_CB(bcn)->paddr = dma_map_single(arvif->ar->dev,
 							   bcn->data, bcn->len,
 							   DMA_TO_DEVICE);
-- 
1.8.5.3




More information about the ath10k mailing list