[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1441283463-51050-5-git-send-email-kan.liang@intel.com>
Date: Thu, 3 Sep 2015 08:31:00 -0400
From: kan.liang@...el.com
To: acme@...nel.org, jolsa@...nel.org
Cc: a.p.zijlstra@...llo.nl, luto@...nel.org, mingo@...hat.com,
eranian@...gle.com, ak@...ux.intel.com, mark.rutland@....com,
adrian.hunter@...el.com, namhyung@...nel.org,
linux-kernel@...r.kernel.org, Kan Liang <kan.liang@...el.com>
Subject: [PATCH V8 4/7] perf,tools: fix dump_sample crash when evsel is NULL.
From: Kan Liang <kan.liang@...el.com>
Need to check evsel before using in dump_sample.
Signed-off-by: Kan Liang <kan.liang@...el.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists