]> Git Repo - qemu.git/commitdiff
mempath prefault: fix off-by-one error
authorMarcelo Tosatti <[email protected]>
Wed, 18 Dec 2013 18:42:17 +0000 (16:42 -0200)
committerMarcelo Tosatti <[email protected]>
Mon, 30 Dec 2013 21:05:11 +0000 (19:05 -0200)
Fix off-by-one error (noticed by Andrea Arcangeli).

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
exec.c

diff --git a/exec.c b/exec.c
index 896f7b83fc23fb116dd35059af148946c5bbc2ba..52d451b5474ae9503a6c02cda1f2ffd988dcb707 100644 (file)
--- 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);
         }
 
This page took 0.023069 seconds and 4 git commands to generate.