diff options
author | Nico Huber <nico.huber@secunet.com> | 2018-12-06 15:46:26 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-12-07 11:34:54 +0000 |
commit | 6ee37ef59ddf5e7f005e0aa24541b190384ab87c (patch) | |
tree | 3eca8253a40a0b66084195a3a3860d2c1066fac5 /src/lib | |
parent | 500d81a95a694ddf827f20b853a76de7fd84e1b5 (diff) | |
download | coreboot-6ee37ef59ddf5e7f005e0aa24541b190384ab87c.tar.xz |
cbfs: Alert if something goes wrong in cbfs_boot_locate()
Change-Id: I5a3cb41b3a7ff2aa527cc2b40c9d7438474c2f93
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/30084
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/cbfs.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 9ea7df6ed2..a5c9f85238 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -41,17 +41,23 @@ int cbfs_boot_locate(struct cbfsf *fh, const char *name, uint32_t *type) const struct region_device *boot_dev; struct cbfs_props props; - if (cbfs_boot_region_properties(&props)) + if (cbfs_boot_region_properties(&props)) { + printk(BIOS_ALERT, "ERROR: Failed to locate boot region\n"); return -1; + } /* All boot CBFS operations are performed using the RO device. */ boot_dev = boot_device_ro(); - if (boot_dev == NULL) + if (boot_dev == NULL) { + printk(BIOS_ALERT, "ERROR: Failed to find boot device\n"); return -1; + } - if (rdev_chain(&rdev, boot_dev, props.offset, props.size)) + if (rdev_chain(&rdev, boot_dev, props.offset, props.size)) { + printk(BIOS_ALERT, "ERROR: Failed to access boot region inside boot device\n"); return -1; + } return cbfs_locate(fh, &rdev, name, type); } |