Răsfoiți Sursa

qcacld-3.0: Add null check for mac

Pointer mac is returned from function cds_get_context which might return
NULL. So NULL check for mac pointer is added before dereferencing it.

Change-Id: I9258dc625144650c077fd457827fc24610732b77
CRs-Fixed: 3746451
Manoj Shanmugam 1 an în urmă
părinte
comite
3798d44679
1 a modificat fișierele cu 5 adăugiri și 0 ștergeri
  1. 5 0
      core/wma/src/wma_features.c

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

@@ -3231,6 +3231,11 @@ static QDF_STATUS wma_wow_pagefault_action_cb(void *buf)
 {
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 
+	if (!mac) {
+		wma_err("NULL mac ptr");
+		return QDF_STATUS_E_INVAL;
+	}
+
 	return mac->sme.pagefault_action_cb(buf, WLAN_WMA_PF_APPS_NOTIFY_BUF_LEN);
 }