mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
6bdf863d94
commit
2ba8285289
2
exec.c
2
exec.c
|
@ -1001,7 +1001,7 @@ static void *file_ram_alloc(RAMBlock *block,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MAP_POPULATE silently ignores failures */
|
/* 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);
|
memset(area + (hpagesize*i), 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue