소스 검색

qcacld-3.0: Avoid calling memory allocation function for allocation size 0

qcacld-2.0 to qcacld-3.0 propagation

Currently we are calling memory allocation function to allocate memory for
FT ies even though FT ies length is 0.
Due to above behavior we are seeing unnecessary memory allocation failure
error prints.
Change made to check for FT ies length before calling memory allocation
function.

Change-Id: I3f9ddee1d66f51088526f6d370c83697178be925
CRs-Fixed: 930118
Edhar, Mahesh Kumar 9 년 전
부모
커밋
e0c65cae25
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      core/sme/src/csr/csr_api_roam.c

+ 3 - 0
core/sme/src/csr/csr_api_roam.c

@@ -17922,6 +17922,9 @@ void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
 			pSession->ftSmeContext.reassoc_ft_ies = NULL;
 		}
 
+		if (!ft_ies_length)
+			return;
+
 		pSession->ftSmeContext.reassoc_ft_ies =
 			cdf_mem_malloc(ft_ies_length);
 		if (NULL == pSession->ftSmeContext.reassoc_ft_ies) {