diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2017-12-19 11:17:19 -0800 |
|---|---|---|
| committer | Dustin Brown <dustinb@codeaurora.org> | 2017-12-19 11:29:54 -0800 |
| commit | 2fd7a0c5c2139598a415a97131cfd88369820320 (patch) | |
| tree | a9cb756403c29cf5ee46f0388b2d88b7b4101077 | |
| parent | 5dc87d9c56e563be3517e5f7fbf1e6b1115a68a7 (diff) | |
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
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index e870c8b7b933..b9e604dc3c83 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2009,8 +2009,23 @@ static void hdd_update_hw_sw_info(hdd_context_t *hdd_ctx) hdd_wlan_get_version(hdd_ctx, NULL, NULL); } +/** + * 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(); qdf_nbuf_map_check_for_leaks(); qdf_mem_check_for_leaks(); |
