qcacmn: Add NULL check for HIF device before dereferencing
Propagation from qcacld-2.0 to qcacmn.
Add NULL check for HIF device structure in hif_enable_func before
dereferencing it.
Change-Id: I535d5138c2247b4b9acdf63211f30a57a1d3116f
CRs-Fixed: 1055684
diff --git a/hif/src/sdio/native_sdio/src/hif.c b/hif/src/sdio/native_sdio/src/hif.c
index e80a6bb..4a813d0 100644
--- a/hif/src/sdio/native_sdio/src/hif.c
+++ b/hif/src/sdio/native_sdio/src/hif.c
@@ -2013,6 +2013,11 @@
device = get_hif_device(func);
+ if (!device) {
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HIF device is NULL\n"));
+ return QDF_STATUS_E_INVAL;
+ }
+
if (device->is_disabled) {
int setAsyncIRQ = 0;
__u16 manufacturer_id =