Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Alice Ryhl and committed by
Greg Kroah-Hartman
ed72cfff 12c68808

+2 -2
+2 -2
drivers/android/binder/process.rs
··· 682 682 fn get_current_thread(self: ArcBorrow<'_, Self>) -> Result<Arc<Thread>> { 683 683 let id = { 684 684 let current = kernel::current!(); 685 - if !core::ptr::eq(current.group_leader(), &*self.task) { 685 + if self.task != current.group_leader() { 686 686 pr_err!("get_current_thread was called from the wrong process."); 687 687 return Err(EINVAL); 688 688 } ··· 1672 1672 vma: &mm::virt::VmaNew, 1673 1673 ) -> Result { 1674 1674 // We don't allow mmap to be used in a different process. 1675 - if !core::ptr::eq(kernel::current!().group_leader(), &*this.task) { 1675 + if this.task != kernel::current!().group_leader() { 1676 1676 return Err(EINVAL); 1677 1677 } 1678 1678 if vma.start() == 0 {