diff --git a/Kernel/VM/TypedMapping.h b/Kernel/VM/TypedMapping.h index 61ca1fb6ac1..b9cc3ac36c5 100644 --- a/Kernel/VM/TypedMapping.h +++ b/Kernel/VM/TypedMapping.h @@ -27,7 +27,8 @@ template static TypedMapping map_typed(PhysicalAddress paddr, size_t length, Region::Access access = Region::Access::Read) { TypedMapping table; - table.region = MM.allocate_kernel_region(paddr.page_base(), page_round_up(length), {}, access); + size_t mapping_length = page_round_up(paddr.offset_in_page() + length); + table.region = MM.allocate_kernel_region(paddr.page_base(), mapping_length, {}, access); table.offset = paddr.offset_in_page(); return table; }