rust_binder: make use of == for Task

Now that we have implemented the == operator for Task, replace the two
raw pointer comparisons in Binder with the == operator.

Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260324-close-fd-check-current-v3-3-b94274bedac7@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alice Ryhl 2026-03-24 20:02:37 +00:00 committed by Greg Kroah-Hartman
parent 12c688086f
commit ed72cfffc4

View File

@ -682,7 +682,7 @@ pub(crate) fn get_work_or_register<'a>(
fn get_current_thread(self: ArcBorrow<'_, Self>) -> Result<Arc<Thread>> {
let id = {
let current = kernel::current!();
if !core::ptr::eq(current.group_leader(), &*self.task) {
if self.task != current.group_leader() {
pr_err!("get_current_thread was called from the wrong process.");
return Err(EINVAL);
}
@ -1672,7 +1672,7 @@ pub(crate) fn mmap(
vma: &mm::virt::VmaNew,
) -> Result {
// We don't allow mmap to be used in a different process.
if !core::ptr::eq(kernel::current!().group_leader(), &*this.task) {
if this.task != kernel::current!().group_leader() {
return Err(EINVAL);
}
if vma.start() == 0 {