From e2e4a4527d18d975cade304998f978bb291a4279 Mon Sep 17 00:00:00 2001 From: Sagar Taunk Date: Sun, 27 Sep 2026 12:56:45 +0000 Subject: [PATCH] rust_binder: allocation: call trace_transaction_failed_buffer_release() Call `trace_transaction_failed_buffer_release()` when transaction fails in `NewAllocation`'s destructor. This provides visibility into the failed buffer releases. Signed-off-by: Sagar Taunk Link: https://patch.msgid.link/20260927125622.676342-3-sagartaunk@proton.me Signed-off-by: Greg Kroah-Hartman --- drivers/android/binder/allocation.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/android/binder/allocation.rs b/drivers/android/binder/allocation.rs index 2f0763e6868d..19ee626b5b89 100644 --- a/drivers/android/binder/allocation.rs +++ b/drivers/android/binder/allocation.rs @@ -20,6 +20,7 @@ defs::*, node::{Node, NodeRef}, process::Process, + trace::trace_transaction_failed_buffer_release, DArc, }; @@ -325,6 +326,12 @@ fn deref_mut(&mut self) -> &mut Allocation { } } +impl Drop for NewAllocation { + fn drop(&mut self) { + trace_transaction_failed_buffer_release(self.debug_id); + } +} + /// A view into the beginning of an allocation. /// /// All attempts to read or write outside of the view will fail. To intentionally access outside of