Browse Source

qcacld-3.0: Cleanup logging

qcacld-2.0 to qcacld-3.0 propagation

Some of the logs are misleading to believe that there are
some memory related issue which infact is not. Cleanup the
logs to convey the exact message that has to be conveyed for
those scenarios

CRs-Fixed: 907715
Change-Id: Iaab688eb9b8b19705b3d87c4efe1c7ef29ccf613
Varun Reddy Yeturu 9 years ago
parent
commit
61ce89cfd8

+ 29 - 21
core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c

@@ -347,20 +347,24 @@ static void lim_update_ric_data(tpAniSirGlobal mac_ctx,
 	if (assoc_rsp->ricPresent) {
 		session_entry->RICDataLen =
 			assoc_rsp->num_RICData * sizeof(tDot11fIERICDataDesc);
-		session_entry->ricData =
-			cdf_mem_malloc(session_entry->RICDataLen);
-		if (NULL == session_entry->ricData) {
-			lim_log(mac_ctx, LOGE,
-				FL("Assoc res/RIC: Unable to allocate memory"));
-			session_entry->RICDataLen = 0;
+		if (session_entry->RICDataLen) {
+			session_entry->ricData =
+				cdf_mem_malloc(session_entry->RICDataLen);
+			if (NULL == session_entry->ricData) {
+				lim_log(mac_ctx, LOGE,
+					FL("No memory for RIC data"));
+				session_entry->RICDataLen = 0;
+			} else {
+				cdf_mem_copy(session_entry->ricData,
+					&assoc_rsp->RICData[0],
+					session_entry->RICDataLen);
+			}
 		} else {
-			cdf_mem_copy(session_entry->ricData,
-				&assoc_rsp->RICData[0],
-				session_entry->RICDataLen);
+			lim_log(mac_ctx, LOGE, FL("RIC data not present"));
 		}
 	} else {
 		lim_log(mac_ctx, LOG1,
-			FL("Ric is not present,Set RICDataLen & RicData to 0"));
+				FL("Ric is not present"));
 		session_entry->RICDataLen = 0;
 		session_entry->ricData = NULL;
 	}
@@ -389,25 +393,29 @@ static void lim_update_ese_tspec(tpAniSirGlobal mac_ctx,
 		session_entry->tspecIes = NULL;
 	}
 	if (assoc_rsp->tspecPresent) {
+		lim_log(mac_ctx, LOG1, FL("Tspec EID present in assoc rsp"));
 		session_entry->tspecLen =
 			assoc_rsp->num_tspecs * sizeof(tDot11fIEWMMTSPEC);
-		session_entry->tspecIes =
-			cdf_mem_malloc(session_entry->tspecLen);
-		if (NULL == session_entry->tspecIes) {
-			lim_log(mac_ctx, LOGE,
-				FL("Assoc Rsp/Tspec:Fail to allocate memory"));
-			session_entry->tspecLen = 0;
+		if (session_entry->tspecLen) {
+			session_entry->tspecIes =
+				cdf_mem_malloc(session_entry->tspecLen);
+			if (NULL == session_entry->tspecIes) {
+				lim_log(mac_ctx, LOGE,
+					FL("Tspec IE:Fail to allocate memory"));
+				session_entry->tspecLen = 0;
+			} else {
+				cdf_mem_copy(session_entry->tspecIes,
+						&assoc_rsp->TSPECInfo[0],
+						session_entry->tspecLen);
+			}
 		} else {
-			cdf_mem_copy(session_entry->tspecIes,
-				&assoc_rsp->TSPECInfo[0],
-				session_entry->tspecLen);
+			lim_log(mac_ctx, LOGE, FL("TSPEC has Zero length"));
 		}
-		lim_log(mac_ctx, LOG1, FL(" Tspec EID present in assoc rsp "));
 	} else {
 		session_entry->tspecLen = 0;
 		session_entry->tspecIes = NULL;
 		lim_log(mac_ctx, LOG1,
-			FL(" Tspec EID *NOT* present in assoc rsp "));
+			FL("Tspec EID *NOT* present in assoc rsp"));
 	}
 	return;
 }

+ 17 - 16
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -2359,19 +2359,23 @@ lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal mac_ctx,
 		cdf_mem_free(pe_session->assocReq);
 		pe_session->assocReq = NULL;
 	}
-
-	pe_session->assocReq = cdf_mem_malloc(ft_ies_length);
-	if (NULL == pe_session->assocReq) {
-		lim_log(mac_ctx, LOGE, FL("Failed to alloc memory"));
-		pe_session->assocReqLen = 0;
+	if (ft_ies_length) {
+		pe_session->assocReq = cdf_mem_malloc(ft_ies_length);
+		if (NULL == pe_session->assocReq) {
+			lim_log(mac_ctx,
+				LOGE, FL("Failed to alloc memory for FT IEs"));
+			pe_session->assocReqLen = 0;
+		} else {
+			/*
+			 * Store the FT IEs. This is sent to csr/hdd in
+			 * join cnf response.
+			 */
+			cdf_mem_copy(pe_session->assocReq,
+				ft_sme_context->reassoc_ft_ies, ft_ies_length);
+			pe_session->assocReqLen = ft_ies_length;
+		}
 	} else {
-		/*
-		 * Store the Assoc request. This is sent to csr/hdd in
-		 * join cnf response.
-		 */
-		cdf_mem_copy(pe_session->assocReq,
-			     ft_sme_context->reassoc_ft_ies, (ft_ies_length));
-		pe_session->assocReqLen = (ft_ies_length);
+		lim_log(mac_ctx, LOG1, FL("FT IEs not present"));
 	}
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT
@@ -2692,10 +2696,7 @@ lim_send_reassoc_req_mgmt_frame(tpAniSirGlobal pMac,
 
 	psessionEntry->assocReq = cdf_mem_malloc(nPayload);
 	if (NULL == psessionEntry->assocReq) {
-		PELOGE(lim_log
-			       (pMac, LOGE,
-			       FL("Unable to allocate memory to store assoc request"));
-		       )
+		lim_log(pMac, LOGE, FL("Unable to allocate mem for assoc req"));
 	} else {
 		/* Store the Assoc request. This is sent to csr/hdd in join cnf response. */
 		cdf_mem_copy(psessionEntry->assocReq,