mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 03:01:02 +00:00
exec: fix madvise of NULL pointer
Coverity flags this as "dereference after null check". Not quite a dereference, since it will just EFAULT, but still nice to fix. Backports commit a904c91196a9c5dbd7b9abcd3d40b0824286fb1c from qemu
This commit is contained in:
parent
e07cd2542c
commit
15b3a9358e
12
qemu/exec.c
12
qemu/exec.c
|
@ -1113,9 +1113,15 @@ static ram_addr_t ram_block_add(struct uc_struct *uc, RAMBlock *new_block, Error
|
|||
new_block->used_length,
|
||||
DIRTY_CLIENTS_ALL);
|
||||
|
||||
qemu_ram_setup_dump(new_block->host, new_block->max_length);
|
||||
//qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_HUGEPAGE);
|
||||
//qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_DONTFORK);
|
||||
if (new_block->host) {
|
||||
qemu_ram_setup_dump(new_block->host, new_block->max_length);
|
||||
// Unicorn: commented out
|
||||
//qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_HUGEPAGE);
|
||||
//qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_DONTFORK);
|
||||
//if (kvm_enabled()) {
|
||||
// kvm_setup_guest_memory(new_block->host, new_block->max_length);
|
||||
//}
|
||||
}
|
||||
|
||||
return new_block->offset;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue