summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-02-27 23:15:01 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-13 10:00:46 +0100
commiteba3fa5e72e0dd204ef5d2220ceaad74220e2a9f (patch)
tree34115d8092cda074f30ace4ce3dd6d8c9b7de055 /Kernel/Syscalls
parentb7f1171a1ce5e81ac24a13380dda626854bb28b1 (diff)
downloadserenity-eba3fa5e72e0dd204ef5d2220ceaad74220e2a9f.zip
Kernel: Make munmap more posix compliant
In case someone tries to unmap a not mapped region (fallback) we should not return an error, but silently do nothing
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/mmap.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp
index 4d07e44643..68447db9f2 100644
--- a/Kernel/Syscalls/mmap.cpp
+++ b/Kernel/Syscalls/mmap.cpp
@@ -494,9 +494,6 @@ KResultOr<int> Process::sys$munmap(Userspace<void*> addr, size_t size)
// Try again while checkin multiple regions at a time
// slow: without caching
const auto& regions = space().find_regions_intersecting(range_to_unmap);
- // if there still no regions found error out
- if (!regions.size())
- return EINVAL;
// check if any of the regions is not mmaped, to not accientally
// error-out with just half a region map left
@@ -529,6 +526,7 @@ KResultOr<int> Process::sys$munmap(Userspace<void*> addr, size_t size)
for (auto* new_region : new_regions) {
new_region->map(space().page_directory());
}
+
return 0;
}