diff --git a/Kernel/VM/Space.cpp b/Kernel/VM/Space.cpp index cf165ea348..fb89991906 100644 --- a/Kernel/VM/Space.cpp +++ b/Kernel/VM/Space.cpp @@ -92,7 +92,7 @@ KResult Space::unmap_mmap_range(VirtualAddress addr, size_t size) // Try again while checking multiple regions at a time. auto const& regions = find_regions_intersecting(range_to_unmap); if (regions.is_empty()) - return EINVAL; + return KSuccess; // Check if any of the regions is not mmap'ed, to not accidentally // error out with just half a region map left. diff --git a/Tests/Kernel/TestMunMap.cpp b/Tests/Kernel/TestMunMap.cpp index 206c7c3556..6d8af21d79 100644 --- a/Tests/Kernel/TestMunMap.cpp +++ b/Tests/Kernel/TestMunMap.cpp @@ -10,8 +10,7 @@ TEST_CASE(munmap_zero_page) { - // munmap of the unmapped zero page should always fail. + // munmap of the unmapped zero page should always "succeed". auto res = munmap(0x0, 0xF); - EXPECT_EQ(res, -1); - EXPECT_EQ(errno, EINVAL); + EXPECT_EQ(res, 0); }