lkml.org 
[lkml]   [2015]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V8 4/7] perf,tools: fix dump_sample crash when evsel is NULL.
Date
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


\
 
 \ /
  Last update: 2015-09-03 22:01    [W:0.084 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site