Browse Source

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 years ago
parent
commit
394c3543c5
1 changed files with 3 additions and 0 deletions
  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) {