lib/imd: Improve check to filter out 0-size imd_entries
Previously it was allowed to create an imd_entry with size 0, however algorithm sets the offset of such entry to the exact same address as the last registered entry. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ifa2cdc887381fb0d268e2c199e868b038aafff5f Reviewed-on: https://review.coreboot.org/c/coreboot/+/44666 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
This commit is contained in:
parent
fc83588e85
commit
93d56f5165
@ -323,7 +323,7 @@ static struct imd_entry *imd_entry_add_to_root(struct imd_root *r, uint32_t id,
|
||||
last_entry = root_last_entry(r);
|
||||
e_offset = last_entry->start_offset;
|
||||
e_offset -= (ssize_t)used_size;
|
||||
if (e_offset > last_entry->start_offset)
|
||||
if (e_offset >= last_entry->start_offset)
|
||||
return NULL;
|
||||
|
||||
entry = root_last_entry(r) + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user