From: Marcelo Tosatti Date: Wed, 18 Dec 2013 18:42:17 +0000 (-0200) Subject: mempath prefault: fix off-by-one error X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~386^2~42^2~228^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ba82852894c762299b7d05e9a2be184116b80f0;p=sdk%2Femulator%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 896f7b83fc..52d451b547 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); }