Messages in this thread Patch in this message | | | From | kan.liang@intel ... | Subject | [PATCH V8 4/7] perf,tools: fix dump_sample crash when evsel is NULL. | Date | Thu, 3 Sep 2015 08:31:00 -0400 |
| |
From: Kan Liang <kan.liang@intel.com>
Need to check evsel before using in dump_sample.
Signed-off-by: Kan Liang <kan.liang@intel.com> --- tools/perf/util/session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 61669be..23fed17 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1080,11 +1080,11 @@ static int machines__deliver_event(struct machines *machines, switch (event->header.type) { case PERF_RECORD_SAMPLE: - dump_sample(evsel, event, sample); if (evsel == NULL) { ++evlist->stats.nr_unknown_id; return 0; } + dump_sample(evsel, event, sample); if (machine == NULL) { ++evlist->stats.nr_unprocessable_samples; return 0; -- 1.8.3.1
| |