Skip to content

Commit 90f1659

Browse files
committed
android: binder: use the new try_* methods
In preparation for enabling `no_global_oom_handling` for `alloc`, we need to stop using methods that will disappear when enabling the configuration option. Instead, we use the new methods we just added. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 3fd100b commit 90f1659

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/android/process.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,11 @@ impl Process {
614614
for _ in 0..page_count {
615615
let page = Pages::<0>::new()?;
616616
page.insert_page(vma, address)?;
617-
pages.push(page);
617+
pages.try_push(page)?;
618618
address += 1 << bindings::PAGE_SHIFT;
619619
}
620620

621-
// TODO: This allocates memory.
622-
let arc = Arc::from(pages);
621+
let arc = Arc::try_from_vec(pages)?;
623622

624623
// Save pages for later.
625624
let mut inner = self.inner.lock();

0 commit comments

Comments
 (0)