Browse Source

qcacld-3.0: Validate session id in SME

As part of cds connection in progress validation
check, CDS is accessing the session id from an
adapter which is just created and initialized with
an invalid sessionid. CDS passes the invalid session
id to SME. SME is trying to access global structure
with the same session id and triggered the crash.

Add a session id validation check in SME before
accessing the global mac structure.

Change-Id: Ic0884b2121509807cabfc62b47238985c0e1356e
CRs-fixed: 1087264
Sandeep Puligilla 8 years ago
parent
commit
ca631617f1
1 changed files with 8 additions and 1 deletions
  1. 8 1
      core/sme/src/common/sme_api.c

+ 8 - 1
core/sme/src/common/sme_api.c

@@ -14845,7 +14845,14 @@ QDF_STATUS sme_wifi_start_logger(tHalHandle hal,
  */
 bool sme_neighbor_middle_of_roaming(tHalHandle hHal, uint8_t sessionId)
 {
-	return csr_neighbor_middle_of_roaming(PMAC_STRUCT(hHal), sessionId);
+	tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal);
+	bool val = false;
+
+	if (CSR_IS_SESSION_VALID(mac_ctx, sessionId))
+		val = csr_neighbor_middle_of_roaming(mac_ctx, sessionId);
+	else
+		sms_log(mac_ctx, LOGE, FL("Invalid Sesion = %d"), sessionId);
+	return val;
 }
 
 /*