소스 검색

qcacmn: Replace kzalloc/kfree with vmalloc/vfree for cfg value store

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 one will be refined to replace malloc
with valloc when CONFIG_ENABLE_VALLOC_REPLACE_MALLOC=y.

1 x 21552 = 21552B@cfg_store_alloc:448

Change-Id: Ic43901453e8194d4f7fc0f8af2e2459bea5495a6
CRs-Fixed: 3426968
Chaoli Zhou 2 년 전
부모
커밋
6f3a375902
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      cfg/src/cfg.c

+ 3 - 3
cfg/src/cfg.c

@@ -445,7 +445,7 @@ cfg_store_alloc(const char *path, struct cfg_value_store **out_store)
 
 	cfg_enter();
 
-	store = qdf_mem_malloc(sizeof(*store));
+	store = qdf_mem_common_alloc(sizeof(*store));
 	if (!store)
 		return QDF_STATUS_E_NOMEM;
 
@@ -472,7 +472,7 @@ free_path:
 	qdf_mem_free(store->path);
 
 free_store:
-	qdf_mem_free(store);
+	qdf_mem_common_free(store);
 
 	return status;
 }
@@ -491,7 +491,7 @@ static void cfg_store_free(struct cfg_value_store *store)
 				status);
 
 	qdf_mem_free(store->path);
-	qdf_mem_free(store);
+	qdf_mem_common_free(store);
 }
 
 static QDF_STATUS