summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwadesong <wadesong@codeaurora.org>2017-10-28 07:15:51 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-11-10 09:56:47 -0800
commit36e2a61672f2c46a5c3e46000b064bbe442af3e1 (patch)
tree546361a75d2ca01d21df3ff9d14ba524ba6ef58d
parent98f3162c59cf77e2c206555db9285de057ea7a47 (diff)
qcacld-3.0: Lock the packet lists before freeing
1) The htt htc free packet list is accessed without being protected by a lock when packets are being removed from it, which may introduce a potential racing condition during stability stress test. Protect the list by htt tx mutex before any pakcets are freed from it. 2) The same protection should be done to the htt htc packet misc list. Change-Id: Ife075a24f119ccfff9b56ec6ce3bee5dd73c9dea CRs-Fixed: 2137038
-rw-r--r--core/dp/htt/htt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c
index f7d59106a738..8adc2fcf7f6c 100644
--- a/core/dp/htt/htt.c
+++ b/core/dp/htt/htt.c
@@ -108,13 +108,16 @@ void htt_htc_pkt_pool_free(struct htt_pdev_t *pdev)
{
struct htt_htc_pkt_union *pkt, *next;
+ HTT_TX_MUTEX_ACQUIRE(&pdev->htt_tx_mutex);
pkt = pdev->htt_htc_pkt_freelist;
+ pdev->htt_htc_pkt_freelist = NULL;
+ HTT_TX_MUTEX_RELEASE(&pdev->htt_tx_mutex);
+
while (pkt) {
next = pkt->u.next;
qdf_mem_free(pkt);
pkt = next;
}
- pdev->htt_htc_pkt_freelist = NULL;
}
#ifdef ATH_11AC_TXCOMPACT
@@ -174,12 +177,16 @@ void htt_htc_misc_pkt_pool_free(struct htt_pdev_t *pdev)
struct htt_htc_pkt_union *pkt, *next;
qdf_nbuf_t netbuf;
+ HTT_TX_MUTEX_ACQUIRE(&pdev->htt_tx_mutex);
pkt = pdev->htt_htc_pkt_misclist;
+ pdev->htt_htc_pkt_misclist = NULL;
+ HTT_TX_MUTEX_RELEASE(&pdev->htt_tx_mutex);
while (pkt) {
next = pkt->u.next;
if (htc_packet_get_magic_cookie(&(pkt->u.pkt.htc_pkt)) !=
HTC_PACKET_MAGIC_COOKIE) {
+ QDF_ASSERT(0);
pkt = next;
continue;
}
@@ -190,7 +197,6 @@ void htt_htc_misc_pkt_pool_free(struct htt_pdev_t *pdev)
qdf_mem_free(pkt);
pkt = next;
}
- pdev->htt_htc_pkt_misclist = NULL;
}
#endif