From 3e1aa66bd423950aa69c3d50d91818af1d16e0a7 Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Wed, 10 Oct 2012 15:54:04 -0700 Subject: [PATCH] lib/kasprintf.c: use kmalloc_track_caller() to get accurate traces for kvasprintf Previously kvasprintf() allocation was being done through kmalloc(), thus producing an inaccurate trace report. This is a common problem: in order to get accurate callsite tracing, a lib/utils function shouldn't allocate kmalloc but instead use kmalloc_track_caller. Signed-off-by: Ezequiel Garcia Cc: Sam Ravnborg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- lib/kasprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kasprintf.c b/lib/kasprintf.c index ae0de80c1c8..32f12150fc4 100644 --- a/lib/kasprintf.c +++ b/lib/kasprintf.c @@ -21,7 +21,7 @@ char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap) len = vsnprintf(NULL, 0, fmt, aq); va_end(aq); - p = kmalloc(len+1, gfp); + p = kmalloc_track_caller(len+1, gfp); if (!p) return NULL; -- 2.20.1