]> Git Repo - linux.git/commit - tools/perf/builtin-kvm.c
perf kvm: Initialize file_name var to fix segfault
authorArnaldo Carvalho de Melo <[email protected]>
Wed, 19 Dec 2012 13:59:29 +0000 (10:59 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 24 Jan 2013 19:40:13 +0000 (16:40 -0300)
commit20914ce5b9e1ef4a35f1f09a2c9c8fb8eb1c4d86
tree3467079f6c41505b1541e14f4119afb2dec8a827
parent34ba5122bf198c9cdfcbecc9b23eaa414244a3f6
perf kvm: Initialize file_name var to fix segfault

The 3786063 commit:

    perf kvm: Rename perf_kvm to perf_kvm_stat

Moved the file_name from inside a local struct var that initialized some
of its members, thus zero initializing the not explicitely initialized
variables, one of which was 'file_name', to a standalone local variable,
but forgot to initialize it explicitely to NULL, so it then got some
undefined value, causing a segfault in strdup when it wasn't, by luck,
zero.

Fix it by explicitely initializing it to NULL.

Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Xiao Guangrong <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-kvm.c
This page took 0.052401 seconds and 4 git commands to generate.