From 6538f769c0bfbfb966fc5d3126ab824864c826ce Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Fri, 13 Dec 2019 18:28:32 +0530 Subject: [PATCH] qcacld-3.0: Add a check for driver status in wlansap_set_band_csa with a new change I9b2b1ead3b4502022aeefc08359037457bb051f9 added for to switch from 2.4g from 5g when an indication is received, During the driver re-initliazation also this function is getting invoked and trying access freed memory resulting in null pointer deference. Donot process the function wlansap_set_band_csa when the driver is recovering. Change-Id: Iab67d5b77ffc98166bf421ff30bcf641e37fef6a CRs-Fixed: 2587706 --- core/sap/src/sap_module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index f8509d034ea4..7380c259c6a2 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -3158,6 +3158,9 @@ void wlansap_set_band_csa(struct sap_context *sap_ctx, uint8_t vdev_id; enum reg_wifi_band sap_band; + if (cds_is_driver_recovering()) + return; + sap_band = wlan_reg_freq_to_band(sap_ctx->chan_freq); sap_debug("SAP/Go current band: %d, pdev band capability: %d", sap_band, band);