Skip to content

Commit e1d2f96

Browse files
committed
samples: rust: Fix for Owned page
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent ead7576 commit e1d2f96

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

samples/rust/rust_dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
use kernel::{
88
bindings, device::Core, dma::CoherentAllocation, page::*, pci, prelude::*, scatterlist::*,
9-
types::ARef,
9+
types::{ARef, Owned},
1010
};
1111

1212
struct DmaSampleDriver {
@@ -76,7 +76,7 @@ impl pci::Driver for DmaSampleDriver {
7676

7777
let mut pages = KVec::new();
7878
for _ in TEST_VALUES.into_iter() {
79-
let _ = pages.push(Page::alloc_page(GFP_KERNEL)?, GFP_KERNEL);
79+
let _ = pages.push(unsafe { Owned::into_raw(Page::alloc_page(GFP_KERNEL)?).read() }, GFP_KERNEL);
8080
}
8181

8282
let sgt = SGTable::alloc_table(PagesArray(pages), GFP_KERNEL)?;

0 commit comments

Comments
 (0)