diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2009-03-25 12:05:57 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-03 14:23:10 +0400 |
commit | 2121db74ba0fd2259f0e2265511684fadda9ac49 (patch) | |
tree | 823401f3bce7018535ceea69103a28accd5794f7 /mm/slob.c | |
parent | c826e3cd0c931d60d548f2468122da570d145556 (diff) | |
download | linux-2121db74ba0fd2259f0e2265511684fadda9ac49.tar.xz |
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 <penberg@cs.helsinki.fi>
Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
LKML-Reference: <1237971957.30175.18.camel@penberg-laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'mm/slob.c')
-rw-r--r-- | mm/slob.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/slob.c b/mm/slob.c index 00003587ebfa..a2d4ab32198d 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -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); |