Sfoglia il codice sorgente

qcacld-3.0: Fix memory leak of assoc req

When SME/CSR layer received assoc indication, can't get session id by
bssid in some cornel cases, assoc req is leaked.

Change-Id: I877887fc0e2fe79a4ade53ba4aebc158fe480c28
CRs-Fixed: 2964966
Jianmin Zhu 3 anni fa
parent
commit
eb8cadbddf
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      core/sme/src/csr/csr_api_roam.c

+ 2 - 1
core/sme/src/csr/csr_api_roam.c

@@ -10028,7 +10028,7 @@ csr_roam_chk_lnk_assoc_ind_upper_layer(
 			&session_id);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		sme_debug("Couldn't find session_id for given BSSID");
-		return;
+		goto free_mem;
 	}
 	csr_send_assoc_ind_to_upper_layer_cnf_msg(
 					mac_ctx, assoc_ind, status, session_id);
@@ -10039,6 +10039,7 @@ csr_roam_chk_lnk_assoc_ind_upper_layer(
 	 *in the csr_send_assoc_ind_to_upper_layer_cnf_msg and
 	 *then free the memroy here.
 	 */
+free_mem:
 	if (assoc_ind->assocReqLength != 0 && assoc_ind->assocReqPtr)
 		qdf_mem_free(assoc_ind->assocReqPtr);
 }