Browse Source

qcacld-3.0: Update dot11mode as per LFR version

Currently driver calculates dot11mode in CSR for LFR-2.0, saves in
global variable pFTPreAuthReq of PE context and later uses that in
lim. But for LFR-3.0, pFTPreAuthReq of PE context is NULL which
can result in NULL pointer access. Add a check for pFTPreAuthReq
to fix this issue.

Change-Id: Ia5cfbca912f9870b9ec7b33a015f4925022f448a
CRs-Fixed: 2055018
Padma, Santhosh Kumar 7 years ago
parent
commit
03c3ad8e75
1 changed files with 9 additions and 1 deletions
  1. 9 1
      core/mac/src/pe/lim/lim_ft.c

+ 9 - 1
core/mac/src/pe/lim/lim_ft.c

@@ -493,6 +493,7 @@ void lim_fill_ft_session(tpAniSirGlobal pMac,
 	int8_t localPowerConstraint;
 	int8_t regMax;
 	tSchBeaconStruct *pBeaconStruct;
+	uint32_t self_dot11_mode;
 	ePhyChanBondState cbEnabledMode;
 
 	pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
@@ -533,8 +534,15 @@ void lim_fill_ft_session(tpAniSirGlobal pMac,
 	qdf_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId,
 		     pftSessionEntry->ssId.length);
 
-	pftSessionEntry->dot11mode =
+	if (psessionEntry->ftPEContext.pFTPreAuthReq &&
+			!pMac->roam.configParam.isRoamOffloadEnabled)
+		pftSessionEntry->dot11mode =
 			psessionEntry->ftPEContext.pFTPreAuthReq->dot11mode;
+	else {
+		wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &self_dot11_mode);
+		pe_debug("selfDot11Mode: %d", self_dot11_mode);
+		pftSessionEntry->dot11mode = self_dot11_mode;
+	}
 	pe_debug("dot11mode: %d", pftSessionEntry->dot11mode);
 	pftSessionEntry->vhtCapability =
 		(IS_DOT11_MODE_VHT(pftSessionEntry->dot11mode)