diff options
author | Jan Dabros <jsd@semihalf.com> | 2020-08-20 08:29:49 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-08-26 07:32:54 +0000 |
commit | 93d56f51653b0310d81d63c5ee0c9e5c252e9cbe (patch) | |
tree | 7d221894d0133a16794875159fcb9226e2542368 /src | |
parent | fc83588e85c5ec080db368f30521e27f1535f34c (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/imd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/imd.c b/src/lib/imd.c index 2b028a7b44..53d0616ab8 100644 --- a/src/lib/imd.c +++ b/src/lib/imd.c @@ -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; |