From 47b772928bf7b896b7a25dbf80fda0fad9d49814 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Wed, 19 Jun 2019 14:01:59 -0700 Subject: [PATCH] qcacld-3.0: Add null check for hdd_ctx in mode change shutdown/restart Add null check for hdd_ctx in mode change shutdown and restart callbacks. Change-Id: I03be071f44b7315aab18d8d38250709553a20a9e CRs-Fixed: 2475044 --- core/hdd/src/wlan_hdd_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 3e30a7a96b86..76ec1eecf4e3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -13628,6 +13628,9 @@ static int hdd_mode_change_psoc_idle_shutdown(struct device *dev) { struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) + return -EINVAL; + return hdd_wlan_stop_modules(hdd_ctx, true); } @@ -13635,6 +13638,9 @@ static int hdd_mode_change_psoc_idle_restart(struct device *dev) { struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) + return -EINVAL; + return hdd_wlan_start_modules(hdd_ctx, false); }