Forráskód Böngészése

qcacld-3.0: Replace kzalloc/kfree with vmalloc/vfree for mac->lim.maxBssId

At continuous physical address limited telematics platform,
in order to avoid occasional memory alloc failure with big
kzalloc size, it's better to use virtual memory allocation
API instead. And below items will be refined to replace
malloc with valloc if CONFIG_ENABLE_VALLOC_REPLACE_MALLOC=y.

1 x 60432 =   60432B @ pe_open:829   mac_open+0xcc/0x160 [qca6698]

Change-Id: I6ffcc83e3f51a89b04661535cf9b8803dd9f0569
CRs-Fixed: 3435173
Chaoli Zhou 2 éve
szülő
commit
c96850ac27
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      core/mac/src/pe/lim/lim_api.c

+ 3 - 3
core/mac/src/pe/lim/lim_api.c

@@ -843,7 +843,7 @@ QDF_STATUS pe_open(struct mac_context *mac, struct cds_config_info *cds_cfg)
 	}
 
 	mac->lim.gpSession =
-		qdf_mem_malloc(sizeof(struct pe_session) * mac->lim.maxBssId);
+		qdf_mem_common_alloc(sizeof(struct pe_session) * mac->lim.maxBssId);
 	if (!mac->lim.gpSession) {
 		status = QDF_STATUS_E_NOMEM;
 		goto pe_open_psession_fail;
@@ -887,7 +887,7 @@ QDF_STATUS pe_open(struct mac_context *mac, struct cds_config_info *cds_cfg)
 	return status; /* status here will be QDF_STATUS_SUCCESS */
 
 pe_open_lock_fail:
-	qdf_mem_free(mac->lim.gpSession);
+	qdf_mem_common_free(mac->lim.gpSession);
 	mac->lim.gpSession = NULL;
 pe_open_psession_fail:
 	qdf_mem_free(mac->lim.lim_timers.gpLimCnfWaitTimer);
@@ -933,7 +933,7 @@ QDF_STATUS pe_close(struct mac_context *mac)
 	qdf_mem_free(mac->lim.lim_timers.gpLimCnfWaitTimer);
 	mac->lim.lim_timers.gpLimCnfWaitTimer = NULL;
 
-	qdf_mem_free(mac->lim.gpSession);
+	qdf_mem_common_free(mac->lim.gpSession);
 	mac->lim.gpSession = NULL;
 
 	pe_free_dph_node_array_buffer();