From: Marcelo Tosatti Date: Wed, 18 Dec 2013 18:42:17 +0000 (-0200) Subject: mempath prefault: fix off-by-one error X-Git-Tag: v2.0.0-rc0~142^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ba82852894c762299b7d05e9a2be184116b80f0;p=thirdparty%2Fqemu.git mempath prefault: fix off-by-one error Fix off-by-one error (noticed by Andrea Arcangeli). Reviewed-by: Paolo Bonzini Signed-off-by: Marcelo Tosatti --- diff --git a/exec.c b/exec.c index 896f7b83fc2..52d451b5474 100644 --- a/exec.c +++ b/exec.c @@ -1001,7 +1001,7 @@ static void *file_ram_alloc(RAMBlock *block, } /* MAP_POPULATE silently ignores failures */ - for (i = 0; i < (memory/hpagesize)-1; i++) { + for (i = 0; i < (memory/hpagesize); i++) { memset(area + (hpagesize*i), 0, 1); }