From a507e41a8763052bf38b24da4c28db04e298d857 Mon Sep 17 00:00:00 2001 From: Alan Chen Date: Fri, 7 Feb 2020 15:35:55 -0800 Subject: [PATCH] qcacld-3.0: Add module enable check in pm_qos_notify pm_qos_notify() should do nothing if WiFi module is not enabled. Change-Id: I8eaf78f2ec547f33921c8337b9b3ae178c1709e1 CRs-Fixed: 2618148 --- core/hdd/src/wlan_hdd_power.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index f4767337f447..c8fa0fbcbf4e 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -951,8 +951,14 @@ int wlan_hdd_pm_qos_notify(struct notifier_block *nb, unsigned long curr_val, { struct hdd_context *hdd_ctx = container_of(nb, struct hdd_context, pm_qos_notifier); - void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + void *hif_ctx; + if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) { + hdd_debug_rl("Driver Module closed; skipping pm qos notify"); + return 0; + } + + hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); if (!hif_ctx) { hdd_err("Hif context is Null"); return -EINVAL;