summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/parse-events.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 17c1c36a7bf9..000c89a1e50d 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -251,8 +251,11 @@ __add_event(struct list_head *list, int *idx,
event_attr_init(attr);
evsel = evsel__new_idx(attr, *idx);
- if (!evsel)
- goto out_err;
+ if (!evsel) {
+ perf_cpu_map__put(cpus);
+ perf_cpu_map__put(pmu_cpus);
+ return NULL;
+ }
if (name) {
evsel->name = strdup(name);