Commit 905ee991 authored by Taeung Song's avatar Taeung Song Committed by Thadeu Lima de Souza Cascardo

perf tools: Only increase index if perf_evsel__new_idx() succeeds

BugLink: http://bugs.launchpad.net/bugs/1731915

[ Upstream commit 75fc5ae5 ]
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>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent a916426e
......@@ -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);
......
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