From f14a6be0eb19a6f47fa4c8ae9c4df9b82a158642 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 1 May 2024 22:10:32 -0400 Subject: kernel: vm_map: Refactor mmap() Signed-off-by: Ian Moffett --- sys/vm/vm_map.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 9e40e95..afe6760 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -387,9 +387,7 @@ mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off) mapping->vmobj = vmobj; mapping->physmem_base = 0; - } - - if (addr == NULL && physmem != 0) { + } else if (addr == NULL && physmem != 0) { map_start = physmem + mapoff; vm_map((void *)map_start, physmem, prot, len); addr = (void *)physmem; -- cgit v1.2.3