Commit 75fc5ae5 authored by Taeung Song's avatar Taeung Song Committed by Arnaldo Carvalho de Melo

perf tools: Only increase index if perf_evsel__new_idx() succeeds

Signed-off-by: default avatarTaeung 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent d5c3a937
......@@ -310,10 +310,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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment