diff --git a/rust/kernel/task.rs b/rust/kernel/task.rs index 72737f5d86abdd..41918aca0a24d2 100644 --- a/rust/kernel/task.rs +++ b/rust/kernel/task.rs @@ -169,7 +169,7 @@ impl Task { /// Returns the given task's pid in the current pid namespace. pub fn pid_in_current_ns(&self) -> Pid { // SAFETY: Calling `task_active_pid_ns` with the current task is always safe. - let namespace = unsafe { bindings::task_active_pid_ns(bindings::get_current()) }; + let namespace = unsafe { bindings::task_active_pid_ns(current!().as_raw()) }; // SAFETY: We know that `self.raw()` is valid by the type invariant. unsafe { bindings::task_tgid_nr_ns(self.as_raw(), namespace) } }