From f3557ff4d1b8b8bac24f2f7b42bb406d389a8b0b Mon Sep 17 00:00:00 2001 From: Ankit Kumar Date: Sat, 12 Oct 2019 15:47:23 +0530 Subject: [PATCH] qcacmn: Increase fw_txrx rem stats counter size rem_stats keeps counter of remaining stats to be processed. At present this counter is of type uint8_t and hence can accumulate till 256 counter but num_stats is of type uint32_t. Hence if remainting stats to be precessed is 256 then rem_stats value will be 0 as it will only consider LSB 8 BITS and it will result in stats mismatch and hence memory leak. Increasing size to uint64_t to accumulate more counter size. Change-Id: Ifa86c7e4a73a5a700e9033c8756e986d86025cf9 --- dp/wifi3.0/dp_htt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 22bed4f2976f..c87f4ff6f604 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -1926,7 +1926,7 @@ void htt_t2h_stats_handler(void *context) uint32_t *msg_word; qdf_nbuf_t htt_msg = NULL; uint8_t done; - uint8_t rem_stats; + uint32_t rem_stats; if (!soc || !qdf_atomic_read(&soc->cmn_init_done)) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, @@ -1959,10 +1959,14 @@ void htt_t2h_stats_handler(void *context) rem_stats = --soc->htt_stats.num_stats; qdf_spin_unlock_bh(&soc->htt_stats.lock); - dp_process_htt_stat_msg(&htt_stats, soc); - /* If there are more stats to process, schedule stats work again */ + /* If there are more stats to process, schedule stats work again. + * Scheduling prior to processing ht_stats to queue with early + * index + */ if (rem_stats) qdf_sched_work(0, &soc->htt_stats.work); + + dp_process_htt_stat_msg(&htt_stats, soc); } /*