aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2013-12-18 16:42:17 -0200
committerMarcelo Tosatti <mtosatti@redhat.com>2013-12-30 19:05:11 -0200
commit2ba82852894c762299b7d05e9a2be184116b80f0 (patch)
tree646cb663bea85d03a33496bf68fa94ab4c57a32c
parent6bdf863d942a267f984e4bd82be80cb2ac5b9915 (diff)
mempath prefault: fix off-by-one error
Fix off-by-one error (noticed by Andrea Arcangeli). Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--exec.c2
1 files changed, 1 insertions, 1 deletions
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);
}