From ba55fd097f4733d79bffda5af3186e04aa20c2e0 Mon Sep 17 00:00:00 2001 From: Rakshith Suresh Patkar Date: Tue, 20 Nov 2018 13:03:43 +0530 Subject: [PATCH] qcacld-3.0: Flush scheduler message queues before htc_stop There is a window where wmi commands are reaching HTC while HTC is getting stopped in other context irrespective of wma_wmi_stop() which will lead to memory leaks. To avoid this issue, flush all scheduler message queues before proceeding to htc_stop. Change-Id: I4d0742d7b9df6a9b0401fd4e840ff6a667d353da CRs-Fixed: 2352291 --- core/cds/src/cds_api.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index ed4ca88676d1..8009829404b9 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -36,6 +36,7 @@ #include "wlan_hdd_power.h" #include "wlan_hdd_tsf.h" #include +#include #include "pld_common.h" #include "sap_api.h" @@ -1050,6 +1051,7 @@ QDF_STATUS cds_post_disable(void) tp_wma_handle wma_handle; struct hif_opaque_softc *hif_ctx; struct cdp_pdev *txrx_pdev; + struct scheduler_ctx *sched_ctx; wma_handle = cds_get_context(QDF_MODULE_ID_WMA); if (!wma_handle) { @@ -1069,6 +1071,11 @@ QDF_STATUS cds_post_disable(void) return QDF_STATUS_E_INVAL; } + /* flush any unprocessed scheduler messages */ + sched_ctx = scheduler_get_context(); + if (sched_ctx) + scheduler_queues_flush(sched_ctx); + /* * With new state machine changes cds_close can be invoked without * cds_disable. So, send the following clean up prerequisites to fw,