mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
kmemtrace: trace kfree() calls with NULL or zero-length objects
Impact: also output kfree(NULL) entries This patch moves the trace_kfree() calls before the ZERO_OR_NULL_PTR check so that we can trace call-sites that call kfree() with NULL many times which might be an indication of a bug. Signed-off-by: Pekka Enberg <[email protected]> Cc: Eduard - Gabriel Munteanu <[email protected]> LKML-Reference: <1237971957.30175.18.camel@penberg-laptop> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
c826e3cd0c
commit
2121db74ba
3 changed files with 6 additions and 6 deletions
|
|
@ -514,6 +514,8 @@ void kfree(const void *block)
|
|||
{
|
||||
struct slob_page *sp;
|
||||
|
||||
trace_kfree(_RET_IP_, block);
|
||||
|
||||
if (unlikely(ZERO_OR_NULL_PTR(block)))
|
||||
return;
|
||||
|
||||
|
|
@ -524,8 +526,6 @@ void kfree(const void *block)
|
|||
slob_free(m, *m + align);
|
||||
} else
|
||||
put_page(&sp->page);
|
||||
|
||||
trace_kfree(_RET_IP_, block);
|
||||
}
|
||||
EXPORT_SYMBOL(kfree);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue