ANDROID: rust_binder: don't drop AllocationInfo in reservation_commit

The destructor of AllocationInfo could potentially sleep. Don't call it
from reservation_commit.

Reported-by: Gary Guo <gary@garyguo.net>
Fixes: dac7c66bc9 ("ANDROID: rust_binder: move Rust Binder in preparation for GKI module")
Change-Id: Iea4d675c7b9db51019739c0b462b9108f7fecf0b
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
Alice Ryhl
2025-08-08 13:27:06 +00:00
committed by Treehugger Robot
parent 138082a939
commit 02e487e3c1
4 changed files with 12 additions and 21 deletions
+2 -2
View File
@@ -1058,10 +1058,10 @@ impl Process {
}
}
pub(crate) fn buffer_make_freeable(&self, offset: usize, data: Option<AllocationInfo>) {
pub(crate) fn buffer_make_freeable(&self, offset: usize, mut data: Option<AllocationInfo>) {
let mut inner = self.inner.lock();
if let Some(ref mut mapping) = &mut inner.mapping {
if mapping.alloc.reservation_commit(offset, data).is_err() {
if mapping.alloc.reservation_commit(offset, &mut data).is_err() {
pr_warn!("Offset {} failed to be marked freeable\n", offset);
}
}