wlan: Add cfg_ini NULL check before dereferencing
Do cfg_ini NULL check before dereferencing the same to access any
ini parameter.
Change-Id: I041439b3933f016740a209632335e7574c9af5f3
CRs-Fixed: 2195850
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index 4e1b943..857527a 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -2795,7 +2795,7 @@
hddLog(VOS_TRACE_LEVEL_INFO,"Restart Sap as SAP channel is %d "
"and STA channel is %d", pHostapdAdapter->sessionCtx.ap.operatingChannel,
(int)pRoamInfo->pBssDesc->channelId);
- if (pHddCtx->cfg_ini->force_scc_with_ecsa)
+ if (pHddCtx->cfg_ini && pHddCtx->cfg_ini->force_scc_with_ecsa)
{
hdd_schedule_ecsa_chan_change_work(pHddCtx,
pAdapter->sessionId);
@@ -2803,7 +2803,8 @@
else
{
hdd_hostapd_stop(pHostapdAdapter->dev);
- if (pHddCtx->cfg_ini->enable_sap_auth_offload)
+ if (pHddCtx->cfg_ini &&
+ pHddCtx->cfg_ini->enable_sap_auth_offload)
hdd_force_scc_restart_sap(pHostapdAdapter,
pHddCtx, (int)pRoamInfo->pBssDesc->channelId);
}