瀏覽代碼

qcacmn: Use ksize to update kmalloc counters under memory debug

qdf_mem_malloc/free wrappers are using ksize to update the kmalloc counters
of the driver whereas the debug versions of this wrappers are using
requested size itself. To figure out the actual dynamic memory held by
the driver on the debug profile, use ksize for debug versions as well.

Change-Id: I4311f9a450e3fa3e04ac45b1bf7f36a7ff677057
CRs-Fixed: 2449995
Shiva Krishna Pittala 6 年之前
父節點
當前提交
92e3f61248
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      qdf/linux/src/qdf_mem.c

+ 2 - 2
qdf/linux/src/qdf_mem.c

@@ -1009,7 +1009,7 @@ void *qdf_mem_malloc_debug(size_t size, const char *func, uint32_t line,
 	if (QDF_IS_STATUS_ERROR(status))
 		qdf_err("Failed to insert memory header; status %d", status);
 
-	qdf_mem_kmalloc_inc(size);
+	qdf_mem_kmalloc_inc(ksize(header));
 
 	return ptr;
 }
@@ -1048,7 +1048,7 @@ void qdf_mem_free_debug(void *ptr, const char *func, uint32_t line)
 	qdf_mem_header_assert_valid(header, current_domain, error_bitmap,
 				    func, line);
 
-	qdf_mem_kmalloc_dec(header->size);
+	qdf_mem_kmalloc_dec(ksize(header));
 	kfree(header);
 }
 qdf_export_symbol(qdf_mem_free_debug);