Skip to content

Commit e8e774c

Browse files
committed
multiboot2: Fix EFI Memory Map 'last_area' calculation
Correct EFI 'last_area' calculation and align it to be more similar the E820 version. (Previously, iterating the EFI Memory map resulted in a superfluous entry as it ran over the next tag)
1 parent ec24c49 commit e8e774c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

multiboot2/src/memory_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl EFIMemoryMapTag {
140140
let start_area = (&self.first_desc) as *const EFIMemoryDesc;
141141
EFIMemoryAreaIter {
142142
current_area: start_area as u64,
143-
last_area: (self_ptr as u64 + self.size as u64),
143+
last_area: (self_ptr as u64 + (self.size - self.desc_size) as u64),
144144
entry_size: self.desc_size,
145145
phantom: PhantomData,
146146
}

0 commit comments

Comments
 (0)