aboutsummaryrefslogtreecommitdiffstats
path: root/libflashrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'libflashrom.c')
-rw-r--r--libflashrom.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libflashrom.c b/libflashrom.c
index d999efcd..c6a598b6 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -470,8 +470,13 @@ int flashrom_layout_read_from_ifd(struct flashrom_layout **const layout, struct
goto _finalize_ret;
}
- if (chip_layout->base.num_entries != dump_layout.base.num_entries ||
- memcmp(chip_layout->entries, dump_layout.entries, sizeof(dump_layout.entries))) {
+ const struct romentry *chip_entry = layout_next(&chip_layout->base, NULL);
+ const struct romentry *dump_entry = layout_next(&dump_layout.base, NULL);
+ while (chip_entry && dump_entry && !memcmp(chip_entry, dump_entry, sizeof(*chip_entry))) {
+ chip_entry = layout_next(&chip_layout->base, chip_entry);
+ dump_entry = layout_next(&dump_layout.base, dump_entry);
+ }
+ if (chip_entry || dump_entry) {
msg_cerr("Descriptors don't match!\n");
ret = 5;
goto _finalize_ret;