perf evlist: Fix use of uninitialized variable
authorDavid Ahern <[email protected]>
Tue, 2 Jul 2013 19:27:21 +0000 (13:27 -0600)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 12 Jul 2013 16:46:12 +0000 (13:46 -0300)
Fixes valgrind complaint:
==1870== Syscall param write(buf) points to uninitialised byte(s)
==1870==    at 0x4E3F5B0: __write_nocancel (in /lib64/libpthread-2.14.90.so)
==1870==    by 0x449D7C: perf_evlist__start_workload (evlist.c:846)
==1870==    by 0x427BC1: cmd_record (builtin-record.c:561)
==1870==    by 0x419D72: run_builtin (perf.c:319)
==1870==    by 0x4195F2: main (perf.c:376)
==1870==  Address 0x7feffcdd7 is on thread 1's stack

Signed-off-by: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/evlist.c

index 4a901be599edf908fa5f4e96b4e34695097bd704..d8f34e0afbfb6e4abc11ff38c277e5501f2e7ce4 100644 (file)
@@ -838,7 +838,7 @@ out_close_ready_pipe:
 int perf_evlist__start_workload(struct perf_evlist *evlist)
 {
        if (evlist->workload.cork_fd > 0) {
-               char bf;
+               char bf = 0;
                int ret;
                /*
                 * Remove the cork, let it rip!