Commit 337fa2db authored by Andreas Herrmann's avatar Andreas Herrmann Committed by Arnaldo Carvalho de Melo

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: default avatarJames Clark <james.clark@arm.com>
Signed-off-by: default avatarAndreas Herrmann <aherrmann@suse.de>
Link: https://lore.kernel.org/r/20230330074202.14052-1-aherrmann@suse.deSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 5a892c3d
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment