Prechádzať zdrojové kódy

qcacld-3.0: Add NULL check for pm_ctx pointer

Add NULL check for pm_ctx pointer to avoid NULL pointer deference
in function policy_mgr_pcl_modification_for_sap().

Change-Id: Ibc32e5dace8eddd1b88775af6ce76ae62fc76a1e
CRs-Fixed: 3626754
Huashan Qu 1 rok pred
rodič
commit
98cfb3eac3

+ 4 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -1339,6 +1339,10 @@ static QDF_STATUS policy_mgr_pcl_modification_for_sap(
 	bool srd_chan_enabled;
 
 	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("Invalid context");
+		return QDF_STATUS_E_FAILURE;
+	}
 
 	/* check the channel avoidance list for beaconing entities */
 	policy_mgr_update_with_safe_channel_list(psoc, pcl_channels,