mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 07:31:45 +00:00
perf tools: Only increase index if perf_evsel__new_idx() succeeds
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>
This commit is contained in:
parent
d5c3a937e0
commit
75fc5ae5cc
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user