From: Alice Ryhl Date: Tue, 24 Mar 2026 20:02:37 +0000 (+0000) Subject: rust_binder: make use of == for Task X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed72cfffc491c88996addd387586234dd8141ee4;p=thirdparty%2Flinux.git 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 Signed-off-by: Alice Ryhl Link: https://patch.msgid.link/20260324-close-fd-check-current-v3-3-b94274bedac7@google.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs index ae26fe817794..312e5c3f14cd 100644 --- a/drivers/android/binder/process.rs +++ b/drivers/android/binder/process.rs @@ -682,7 +682,7 @@ impl Process { fn get_current_thread(self: ArcBorrow<'_, Self>) -> Result> { 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 @@ impl Process { 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 {