Handle vm_map_wire()'s failure.

This commit is contained in:
Alan Cox 2005-08-28 05:38:40 +00:00
parent 5d3043ce9a
commit 7f1ef325d7

View File

@ -650,9 +650,13 @@ link_elf_load_file(linker_class_t cls, const char *filename,
}
/* Wire the pages */
vm_map_wire(kernel_map, mapbase,
error = vm_map_wire(kernel_map, mapbase,
mapbase + round_page(mapsize),
VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES);
if (error != KERN_SUCCESS) {
error = ENOMEM;
goto out;
}
/* Inform the kld system about the situation */
lf->address = ef->address = (caddr_t)mapbase;