Blob Blame History Raw
From 3dfe8a98ffab1c5194818f623f4bcf80d49f3a07 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Mon, 24 Feb 2014 14:59:16 +0100
Subject: [PATCH 1/7] mempath prefault: fix off-by-one error

RH-Author: Marcelo Tosatti <mtosatti@redhat.com>
Message-id: <20140224145916.GA9047@amt.cnet>
Patchwork-id: 57767
O-Subject: [RHEL7 qemu-kvm PATCH] mempath prefault: fix off-by-one error
Bugzilla: 1069039
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Radim Krcmar <rkrcmar@redhat.com>
RH-Acked-by: Andrea Arcangeli <aarcange@redhat.com>

commit 2ba82852894c762299b7d05e9a2be184116b80f0 of uq/master branch
of qemu-kvm.git

Fix off-by-one error (noticed by Andrea Arcangeli).

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
BZ: 1069039
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/exec.c b/exec.c
index 6fe2fe7..b7d9e1a 100644
--- a/exec.c
+++ b/exec.c
@@ -980,7 +980,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.7.1