From: Marcelo Tosatti <mtosa...@redhat.com> Fix off-by-one error (noticed by Andrea Arcangeli).
Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com> --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 896f7b8..52d451b 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); } -- 1.8.3.1