[PATCH 2/4] rust_binder: allocation: call trace_transaction_failed_buffer_release()

From: Sagar Taunk

Date: Sun Sep 27 2026 - 08:57:24 EST


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 <sagartaunk@xxxxxxxxx>
---
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 165cb797eb1e..f14c70a07dd2 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
--
2.55.0