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
This commit is contained in:
@@ -2348,8 +2348,23 @@ static void hdd_nan_register_callbacks(struct hdd_context *hdd_ctx)
|
|||||||
}
|
}
|
||||||
#endif
|
#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)
|
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_mc_timer_check_for_leaks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user