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>
This commit is contained in:
Nico Huber 2018-12-06 15:46:26 +01:00 committed by Patrick Georgi
parent 500d81a95a
commit 6ee37ef59d

View file

@ -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);
}