Skip to content
Snippets Groups Projects
Verified Commit 5f4978a6 authored by Jacob Lorentzon's avatar Jacob Lorentzon
Browse files

Return ENOMEM rather than panicking for PML4 alloc.

parent 67cc6799
No related branches found
No related tags found
1 merge request!187No more recursive mapping
......@@ -342,7 +342,7 @@ pub fn clone(flags: CloneFlags, stack_base: usize) -> Result<ContextId> {
let mut active_ktable = unsafe { ActivePageTable::new(TableKind::Kernel) };
let mut new_utable = unsafe {
let frame = allocate_frames(1).expect("no more frames in syscall::clone new_table");
let frame = allocate_frames(1).ok_or(Error::new(ENOMEM))?;
// SAFETY: This is safe because the frame is exclusive, owned, and valid, as we
// have just allocated it.
InactivePageTable::new(&mut active_utable, frame)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment