Skip to content

Commit d2e6fd6

Browse files
committed
pmm: Fix the confusing panic message on OOM
1 parent 6afdb02 commit d2e6fd6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/aero_kernel/src/mem/paging/frame.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ pub fn pmm_alloc(ordering: BuddyOrdering) -> PhysAddr {
153153
let addr = super::FRAME_ALLOCATOR
154154
.0
155155
.get()
156-
.map(|m| m.lock().allocate_frame_inner(ordering).map(|f| f))
157-
.expect("pmm: out of memory")
158-
.expect("pmm: frame allocator not initialized");
156+
.expect("pmm: frame allocator not initialized")
157+
.lock()
158+
.allocate_frame_inner(ordering)
159+
.expect("pmm: out of memory");
159160

160161
let virt = crate::PHYSICAL_MEMORY_OFFSET + addr.as_u64();
161162
let fill_size = BUDDY_SIZE[ordering] as usize;

0 commit comments

Comments
 (0)