From d62104a8b05f19a0eb6c46e2c123ad58a0f3bb64 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Fri, 31 May 2019 12:04:27 -0700 Subject: [PATCH] qcacld-3.0: Add sanity check for hdd context Add sanity check for hdd context and return if hdd context is null. Change-Id: Ibef56ee7d0b0505643e04583a78b4924e4bc20bf CRs-Fixed: 2462701 --- core/hdd/src/wlan_hdd_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index b938b7152662..ac655ee6ccfc 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9267,6 +9267,11 @@ int hdd_psoc_idle_shutdown(struct device *dev) { struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + hdd_err_rl("hdd ctx is null"); + return -EINVAL; + } + if (is_mode_change_psoc_idle_shutdown) return __hdd_mode_change_psoc_idle_shutdown(hdd_ctx); else @@ -9282,6 +9287,11 @@ int hdd_psoc_idle_restart(struct device *dev) { struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + hdd_err_rl("hdd ctx is null"); + return -EINVAL; + } + return __hdd_psoc_idle_restart(hdd_ctx); }