Skip to contentSkip to conversation

mempath prefault: fix off-by-one error

PATCH Marcelo Tosatti 2 participants 2 messages Dec 18, 2013 – Dec 20, 2013 KVM

lore
Share & tools
lore
#0 lore raw

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

exec.c +1 -1
index f4b9ef2..1be5252 100644
@@ -1000,7 +1000,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);
         }
 
maintainer Reviewed-by
#1 lore raw

Il 18/12/2013 19:42, Marcelo Tosatti ha scritto:

Quoted 11 lines

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

exec.c +0 -0
index f4b9ef2..1be5252 100644

exec.c static void *file_ram_alloc(RAMBlock *block, · line 1006

Quoted 8 lines
exec.c +1 -1
@@ -1000,7 +1000,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);
         }