[PATCH] perf: fix perf-lock report coredump

From: Jovi Zhang
Date: Wed Jul 11 2012 - 04:53:57 EST


Check sample type event raw_data is existed in perf.data firstly,
then invoke process_raw_event, otherwise it will coredump.

Signed-off-by: Jovi Zhang <bookjovi@xxxxxxxxx>
---
tools/perf/builtin-lock.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index fd53319..4b0c230 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -860,7 +860,9 @@ static int process_sample_event(struct perf_tool
*tool __used,
return -1;
}

- process_raw_event(sample->raw_data, sample->cpu, sample->time, thread);
+ if (sample->raw_data)
+ process_raw_event(sample->raw_data, sample->cpu, sample->time,
+ thread);

return 0;
}
--
1.7.9.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/