Skip to content

Commit

Permalink
perf_counter tools: Fix uninitialized variable in perf-report.c
Browse files Browse the repository at this point in the history
# make prefix=/usr/local V=1
gcc -o builtin-report.o -c -O2 -ggdb3 -Wall -Werror -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -std=gnu99 -Wdeclaration-after-statement   -DSHA1_HEADER='<openssl/sha.h>'  builtin-report.c
cc1: warnings being treated as errors
builtin-report.c: In function ‘__cmd_report’:
builtin-report.c:626: error: ‘cwdlen’ may be used uninitialized in this function

Signed-off-by: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <new-submission>
  • Loading branch information
Mike Galbraith authored and Ingo Molnar committed Jun 2, 2009
1 parent c1079ab commit 10a2825
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Documentation/perf_counter/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,10 @@ static int __cmd_report(void)
return EXIT_FAILURE;
}
cwdlen = strlen(cwd);
} else
} else {
cwdp = NULL;
cwdlen = 0;
}
remap:
buf = (char *)mmap(NULL, page_size * mmap_window, PROT_READ,
MAP_SHARED, input, offset);
Expand Down

0 comments on commit 10a2825

Please sign in to comment.