mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 21:40:33 +00:00
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
This commit is contained in:
parent
b7f1171a1c
commit
eba3fa5e72
Notes:
sideshowbarker
2024-07-18 21:26:29 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/eba3fa5e72e Pull-request: https://github.com/SerenityOS/serenity/pull/5510 Issue: https://github.com/SerenityOS/serenity/issues/175 Reviewed-by: https://github.com/BenWiederhake Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/tomuta
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue