summaryrefslogtreecommitdiff
path: root/tools/lib/perf/cpumap.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/perf/cpumap.c')
-rw-r--r--tools/lib/perf/cpumap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c
index f93f4e703e4c..ca0215047c32 100644
--- a/tools/lib/perf/cpumap.c
+++ b/tools/lib/perf/cpumap.c
@@ -247,7 +247,7 @@ out:
int perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx)
{
- if (idx < cpus->nr)
+ if (cpus && idx < cpus->nr)
return cpus->map[idx];
return -1;