Skip to content

Commit 092c6f4

Browse files
rust: task: use safe current! macro
1 parent d19c6e5 commit 092c6f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/kernel/task.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Task {
173173
/// Returns the given task's pid in the current pid namespace.
174174
pub fn pid_in_current_ns(&self) -> Pid {
175175
// SAFETY: Calling `task_active_pid_ns` with the current task is always safe.
176-
let namespace = unsafe { bindings::task_active_pid_ns(bindings::get_current()) };
176+
let namespace = unsafe { bindings::task_active_pid_ns(current!().as_raw()) };
177177
// SAFETY: We know that `self.raw()` is valid by the type invariant.
178178
unsafe { bindings::task_tgid_nr_ns(self.as_raw(), namespace) }
179179
}

0 commit comments

Comments
 (0)