summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2019-06-06 11:23:55 +0200
committerNico Huber <nico.h@gmx.de>2019-06-14 16:00:56 +0000
commit911b8d8bc425ad1e519013e68799c494bf60ca4f (patch)
treec79baaae62dd56fcaa2b34af2ad672eb70a7e8b7
parenta724602fe0a573071c50a54e75dbe40ff43ecc1d (diff)
downloadflashrom-911b8d8bc425ad1e519013e68799c494bf60ca4f.tar.gz
flashrom-911b8d8bc425ad1e519013e68799c494bf60ca4f.tar.bz2
flashrom-911b8d8bc425ad1e519013e68799c494bf60ca4f.zip
cli: Add error on missing IFD
When no IFD is present, but the option --ifd is specified, flashrom would just exit without printing a helpful error message. Add error message that IFD could not be read or parsed. Tested on Intel platform without IFD present. Change-Id: Ie1edd7f36f647c52b17799878185d1e69e10d3b0 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33245 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r--libflashrom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libflashrom.c b/libflashrom.c
index f90a22cbc..c5e56ae14 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -353,18 +353,21 @@ int flashrom_layout_read_from_ifd(struct flashrom_layout **const layout, struct
msg_cinfo("done.\n");
if (layout_from_ich_descriptors(chip_layout, desc, 0x1000)) {
+ msg_cerr("Couldn't parse the descriptor!\n");
ret = 3;
goto _finalize_ret;
}
if (dump) {
if (layout_from_ich_descriptors(&dump_layout, dump, len)) {
+ msg_cerr("Couldn't parse the descriptor!\n");
ret = 4;
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))) {
+ msg_cerr("Descriptors don't match!\n");
ret = 5;
goto _finalize_ret;
}