From 0f9832373e51fa2062e9eb16c753afffbc69ace2 Mon Sep 17 00:00:00 2001 From: SaidiReddy Yenuga Date: Thu, 29 Sep 2016 14:47:01 +0530 Subject: qcacld-3.0: Add NULL check in hdd shutdown API hif_ctx can be NULL and accessing it result in crash Add NULL check for hif context to avoid crash CRs-Fixed: 1072608 Change-Id: I979fd09fadb347585ae5a044277d3855d76f94ca --- core/hdd/src/wlan_hdd_driver_ops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 20290b8f9280..1037750d37d3 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -439,6 +439,11 @@ static void wlan_hdd_shutdown(void) { void *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + if (NULL == hif_ctx) { + hdd_err("HIF context NULL"); + return; + } + if (cds_is_load_or_unload_in_progress()) { hdd_err("Load/unload in progress, ignore SSR shutdown"); return; -- cgit v1.2.3