Browse Source

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
SaidiReddy Yenuga 8 years ago
parent
commit
bda2a525b8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      core/hdd/src/wlan_hdd_driver_ops.c

+ 5 - 0
core/hdd/src/wlan_hdd_driver_ops.c

@@ -440,6 +440,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;