summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evlist-hybrid.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/evlist-hybrid.c')
-rw-r--r--tools/perf/util/evlist-hybrid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/evlist-hybrid.c b/tools/perf/util/evlist-hybrid.c
index 7f234215147d..57f02beef023 100644
--- a/tools/perf/util/evlist-hybrid.c
+++ b/tools/perf/util/evlist-hybrid.c
@@ -154,8 +154,8 @@ int evlist__fix_hybrid_cpus(struct evlist *evlist, const char *cpu_list)
perf_cpu_map__put(matched_cpus);
perf_cpu_map__put(unmatched_cpus);
}
-
- ret = (unmatched_count == events_nr) ? -1 : 0;
+ if (events_nr)
+ ret = (unmatched_count == events_nr) ? -1 : 0;
out:
perf_cpu_map__put(cpus);
return ret;