diff options
author | Taeung Song <treeze.taeung@gmail.com> | 2017-10-08 01:37:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-08 12:06:29 +0300 |
commit | 0806eaf13850334e477ea0589812b2c316e0b388 (patch) | |
tree | 21f2c3b906a3a413118a93f5470d966e8e80431b /tools | |
parent | 3b7d9a95ccd38436295ab6598c526dac83504556 (diff) | |
download | linux-0806eaf13850334e477ea0589812b2c316e0b388.tar.xz |
perf tools: Only increase index if perf_evsel__new_idx() succeeds
[ Upstream commit 75fc5ae5cc53fff71041ecadeb3354a2b4c9fe42 ]
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1485952447-7013-2-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/parse-events.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 38304b7e4f81..e81dfb2e239c 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -291,10 +291,11 @@ __add_event(struct list_head *list, int *idx, event_attr_init(attr); - evsel = perf_evsel__new_idx(attr, (*idx)++); + evsel = perf_evsel__new_idx(attr, *idx); if (!evsel) return NULL; + (*idx)++; evsel->cpus = cpu_map__get(cpus); evsel->own_cpus = cpu_map__get(cpus); |