summaryrefslogtreecommitdiffstats
path: root/tools/perf/bench/inject-buildid.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/bench/inject-buildid.c')
-rw-r--r--tools/perf/bench/inject-buildid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/bench/inject-buildid.c b/tools/perf/bench/inject-buildid.c
index 49331743c7..a759eb2328 100644
--- a/tools/perf/bench/inject-buildid.c
+++ b/tools/perf/bench/inject-buildid.c
@@ -362,7 +362,7 @@ static int inject_build_id(struct bench_data *data, u64 *max_rss)
return -1;
for (i = 0; i < nr_mmaps; i++) {
- int idx = rand() % (nr_dsos - 1);
+ int idx = rand() % nr_dsos;
struct bench_dso *dso = &dsos[idx];
u64 timestamp = rand() % 1000000;