[coreboot-gerrit] Change in ...coreboot[master]: cbfs: Alert if something goes wrong in cbfs_boot_locate()

Nico Huber (Code Review) gerrit at coreboot.org
Thu Dec 6 16:27:08 CET 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30084


Change subject: cbfs: Alert if something goes wrong in cbfs_boot_locate()
......................................................................

cbfs: Alert if something goes wrong in cbfs_boot_locate()

Change-Id: I5a3cb41b3a7ff2aa527cc2b40c9d7438474c2f93
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M src/lib/cbfs.c
1 file changed, 9 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/30084/1

diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 9ea7df6..a5c9f85 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -41,17 +41,23 @@
 	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);
 }

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/30084
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5a3cb41b3a7ff2aa527cc2b40c9d7438474c2f93
Gerrit-Change-Number: 30084
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181206/8ddfba9d/attachment.html>


More information about the coreboot-gerrit mailing list