Skip to content

Commit 7f6b5ff

Browse files
CachedAccess: do not leak the page on RW
Signed-off-by: Andy-Python-Programmer <[email protected]>
1 parent 6295e91 commit 7f6b5ff

File tree

1 file changed

+0
-4
lines changed
  • src/aero_kernel/src/fs/block

1 file changed

+0
-4
lines changed

src/aero_kernel/src/fs/block/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ pub trait CachedAccess: BlockDeviceInterface {
219219
let data = &page.data_mut()[page_offset..page_offset + size];
220220
dest[loc..loc + size].copy_from_slice(data);
221221

222-
core::mem::forget(page);
223-
224222
loc += size;
225223
offset = align_down(offset as u64 + Size4KiB::SIZE, Size4KiB::SIZE) as usize;
226224
}
@@ -248,8 +246,6 @@ pub trait CachedAccess: BlockDeviceInterface {
248246
&buffer[loc..loc + size],
249247
);
250248

251-
core::mem::forget(page);
252-
253249
loc += size;
254250
offset = align_down(offset as u64 + Size4KiB::SIZE, Size4KiB::SIZE) as usize;
255251
}

0 commit comments

Comments
 (0)