From: Arnaldo Carvalho de Melo Date: Fri, 29 May 2015 12:48:13 +0000 (-0300) Subject: perf kmem: Fix compiler warning about may be accessing uninitialized variable X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b236512280fb;p=linux-beck.git perf kmem: Fix compiler warning about may be accessing uninitialized variable The last argument to strtok_r doesn't need to be initialized, its just a placeholder to make this routine reentrant, but gcc doesn't know about that and complains, breaking the build, fix it by setting it to NULL. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/n/tip-8e8rgbg3aom9uarsyqjrsctg@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 254614b10c4a..950f296dfcf7 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c @@ -644,7 +644,7 @@ static char *compact_gfp_flags(char *gfp_flags) { char *orig_flags = strdup(gfp_flags); char *new_flags = NULL; - char *str, *pos; + char *str, *pos = NULL; size_t len = 0; if (orig_flags == NULL)