From 6ee37ef59ddf5e7f005e0aa24541b190384ab87c Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 6 Dec 2018 15:46:26 +0100 Subject: cbfs: Alert if something goes wrong in cbfs_boot_locate() Change-Id: I5a3cb41b3a7ff2aa527cc2b40c9d7438474c2f93 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/30084 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/lib/cbfs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3