Browse Source

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
Himanshu Agarwal 8 years ago
parent
commit
df9ac5731e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      hif/src/sdio/native_sdio/src/hif.c

+ 5 - 0
hif/src/sdio/native_sdio/src/hif.c

@@ -2013,6 +2013,11 @@ static QDF_STATUS hif_enable_func(struct hif_sdio_dev *device,
 
 	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 =