0a122b
From 3dfe8a98ffab1c5194818f623f4bcf80d49f3a07 Mon Sep 17 00:00:00 2001
0a122b
From: Marcelo Tosatti <mtosatti@redhat.com>
0a122b
Date: Mon, 24 Feb 2014 14:59:16 +0100
0a122b
Subject: [PATCH 1/7] mempath prefault: fix off-by-one error
0a122b
0a122b
RH-Author: Marcelo Tosatti <mtosatti@redhat.com>
0a122b
Message-id: <20140224145916.GA9047@amt.cnet>
0a122b
Patchwork-id: 57767
0a122b
O-Subject: [RHEL7 qemu-kvm PATCH] mempath prefault: fix off-by-one error
0a122b
Bugzilla: 1069039
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
RH-Acked-by: Radim Krcmar <rkrcmar@redhat.com>
0a122b
RH-Acked-by: Andrea Arcangeli <aarcange@redhat.com>
0a122b
0a122b
commit 2ba82852894c762299b7d05e9a2be184116b80f0 of uq/master branch
0a122b
of qemu-kvm.git
0a122b
0a122b
Fix off-by-one error (noticed by Andrea Arcangeli).
0a122b
0a122b
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
0a122b
BZ: 1069039
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 exec.c |    2 +-
0a122b
 1 files changed, 1 insertions(+), 1 deletions(-)
0a122b
0a122b
diff --git a/exec.c b/exec.c
0a122b
index 6fe2fe7..b7d9e1a 100644
0a122b
--- a/exec.c
0a122b
+++ b/exec.c
0a122b
@@ -980,7 +980,7 @@ static void *file_ram_alloc(RAMBlock *block,
0a122b
         }
0a122b
 
0a122b
         /* MAP_POPULATE silently ignores failures */
0a122b
-        for (i = 0; i < (memory/hpagesize)-1; i++) {
0a122b
+        for (i = 0; i < (memory/hpagesize); i++) {
0a122b
             memset(area + (hpagesize*i), 0, 1);
0a122b
         }
0a122b
 
0a122b
-- 
0a122b
1.7.1
0a122b