mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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
1 changed files with 1 additions and 1 deletions
2
exec.c
2
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue