mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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 <elezegarcia@gmail.com> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
4ed134beee
commit
3e1aa66bd4
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue