From ed44d51f7dcaee989d6f36bab8042f438692e7ce Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 2 May 2025 12:38:02 -0400 Subject: off by one --- kernel/memory/physalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/memory/physalloc.c b/kernel/memory/physalloc.c index 4255339..47522b8 100644 --- a/kernel/memory/physalloc.c +++ b/kernel/memory/physalloc.c @@ -27,7 +27,7 @@ static const char *segment_type_str[] = { static int n_pages(const struct memory_segment *m) { - return m->len / PAGE_SIZE; + return (m->len + PAGE_SIZE - 1) / PAGE_SIZE; } static void *page_at(int i) -- cgit v1.2.3-freya