diff options
author | Robert Richter <robert.richter@amd.com> | 2011-12-15 11:32:39 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-12-20 10:26:47 -0500 |
commit | f3bda2c9a689b38c059f7cb2d761ff58a2996370 (patch) | |
tree | dd3962fd82b6cb5e6b8a87a0ba9dbb90c36a7c68 /tools | |
parent | 3e76ac78b08479e84a3eca3fb1b3066fb8230461 (diff) |
perf evsel: Fix uninitialized memory access to struct perf_sample
Memory in struct perf_sample is not fully initialized during parsing.
Depending on sampling data some parts may left unchanged. Zero out
struct perf_sample first to avoid access to uninitialized memory.
Cc: Ingo Molnar <mingo@elte.hu>
Link: http://lkml.kernel.org/r/1323966762-8574-2-git-send-email-robert.richter@amd.com
Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 60ad0286759e..667f3b78bb2c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -460,7 +460,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type, | |||
460 | u32 val32[2]; | 460 | u32 val32[2]; |
461 | } u; | 461 | } u; |
462 | 462 | ||
463 | 463 | memset(data, 0, sizeof(*data)); | |
464 | data->cpu = data->pid = data->tid = -1; | 464 | data->cpu = data->pid = data->tid = -1; |
465 | data->stream_id = data->id = data->time = -1ULL; | 465 | data->stream_id = data->id = data->time = -1ULL; |
466 | 466 | ||