diff --git a/kernel/src/arch/riscv/irq.rs b/kernel/src/arch/riscv/irq.rs index 7d70adb16..a1862cbfd 100644 --- a/kernel/src/arch/riscv/irq.rs +++ b/kernel/src/arch/riscv/irq.rs @@ -177,7 +177,7 @@ pub extern "C" fn trap_handler( // we're in an interrupt context, it is safe to access this // global variable. let (previous_pid, previous_context) = unsafe { - PREVIOUS_PAIR.expect("got an instruction page fault with no previous PID") + PREVIOUS_PAIR.take().expect("got an instruction page fault with no previous PID") }; println!( "ISR: Resuming previous pair of ({}, {})",