diff --git a/risc_v/ch3/src/kmem.rs b/risc_v/ch3/src/kmem.rs index 08984e8..1d852f2 100644 --- a/risc_v/ch3/src/kmem.rs +++ b/risc_v/ch3/src/kmem.rs @@ -89,7 +89,7 @@ pub fn kzmalloc(sz: usize) -> *mut u8 { for i in 0..size { unsafe { - (*ret) = 0; + (*ret.add(i)) = 0; } } ret