From 4c5b9901706b14ff70bff5d3565f4fda5136c6cb Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 19 Dec 2017 11:17:19 -0800 Subject: [PATCH] qcacld-3.0: Add hdd_check_for_leaks function docs In cases where memory allocated at runtime is release during module unload, it is tempting to label these memory leaks as false positives. Add documentation to hdd_check_for_leaks explaining why these are real memory leaks. This helps reduce confusion, and helps to dissuade developers from "fixing" the runtime memory leak logic, instead of fixing the memory leak. Change-Id: I2f7574e7465630d2d9f96280ecf8180a51b41e0f CRs-Fixed: 2161394 --- core/hdd/src/wlan_hdd_main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 53219c8b576d..547ae27b9913 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2348,8 +2348,23 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx) } #endif +/** + * hdd_check_for_leaks() - Perform runtime memory leak checks + * + * This API triggers runtime memory leak detection. This feature enforces the + * policy that any memory allocated at runtime must also be released at runtime. + * + * Allocating memory at runtime and releasing it at unload is effectively a + * memory leak for configurations which never unload (e.g. LONU, statically + * compiled driver). Such memory leaks are NOT false positives, and must be + * fixed. + * + * Return: None + */ static void hdd_check_for_leaks(void) { + /* DO NOT REMOVE these checks; for false positives, read above first */ + qdf_mc_timer_check_for_leaks(); }