diff options
author | Andreas Herrmann <aherrmann@suse.de> | 2023-03-30 09:42:02 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-04-04 14:39:56 +0200 |
commit | 337fa2db04785c60fc3aa736af98ce8358f87d34 (patch) | |
tree | b7fe2a7d523a52f20e5ea900b7f4b5b9ae3325ef /tools/perf/bench | |
parent | perf symbol: Remove unused branch_callstack (diff) | |
download | linux-337fa2db04785c60fc3aa736af98ce8358f87d34.tar.xz linux-337fa2db04785c60fc3aa736af98ce8358f87d34.zip |
perf bench numa: Fix type of loop iterator in do_work, it should be 'long'
'j' is of type int and start/end are of type 'long'. Thus 'j' might become
negative and cause segfault in access_data(). Fix it by using 'long' for
'j' as well.
Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Andreas Herrmann <aherrmann@suse.de>
Link: https://lore.kernel.org/r/20230330074202.14052-1-aherrmann@suse.de
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/bench')
-rw-r--r-- | tools/perf/bench/numa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index 9717c6c17433..1fbd7c947abc 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -847,7 +847,7 @@ static u64 do_work(u8 *__data, long bytes, int nr, int nr_max, int loop, u64 val if (g->p.data_rand_walk) { u32 lfsr = nr + loop + val; - int j; + long j; for (i = 0; i < words/1024; i++) { long start, end; |