diff options
author | Namhyung Kim <namhyung@kernel.org> | 2020-09-17 08:02:18 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-09-17 18:28:15 +0200 |
commit | 0f1b550e29c1f9522f0a7a11ee2cf95d33a98d79 (patch) | |
tree | f2566309d974c30c2e422f205c4387908c877689 /tools/perf | |
parent | perf parse-event: Fix cpu map refcounting (diff) | |
download | linux-0f1b550e29c1f9522f0a7a11ee2cf95d33a98d79.tar.xz linux-0f1b550e29c1f9522f0a7a11ee2cf95d33a98d79.zip |
perf parse-event: Release cpu_map refcount if evsel alloc failed
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200917060219.1287863-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/parse-events.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 4c6b3d287d54..fbe0d3143353 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -360,8 +360,10 @@ __add_event(struct list_head *list, int *idx, event_attr_init(attr); evsel = evsel__new_idx(attr, *idx); - if (!evsel) + if (!evsel) { + perf_cpu_map__put(cpus); return NULL; + } (*idx)++; evsel->core.cpus = cpus; |