Browse Source

qcacld-3.0: Add validation code in wma_set_pmo_caps()

Make sure wma is not null before dereferencing.

Change-Id: Ie6b8d3c48257de12ae45ffe0a15079642c29cb30
CRs-Fixed: 2299789
Arif Hussain 6 years ago
parent
commit
eec28b5d97
1 changed files with 5 additions and 0 deletions
  1. 5 0
      core/wma/src/wma_main.c

+ 5 - 0
core/wma/src/wma_main.c

@@ -5605,6 +5605,11 @@ static void wma_set_pmo_caps(struct wlan_objmgr_psoc *psoc)
 	struct pmo_device_caps caps;
 
 	wma = cds_get_context(QDF_MODULE_ID_WMA);
+	if (!wma) {
+		WMA_LOGE("%s: wma handler is null", __func__);
+		return;
+	}
+
 	caps.arp_ns_offload =
 		wmi_service_enabled(wma->wmi_handle, wmi_service_arpns_offload);
 	caps.apf =