[coreboot-gerrit] New patch to review for coreboot: ifdtool: don't write unused regions into a layout file

Alexander Couzens (lynxis@fe80.eu) gerrit at coreboot.org
Sat Oct 8 00:53:35 CEST 2016


Alexander Couzens (lynxis at fe80.eu) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16936

-gerrit

commit 7222f4b0da6107aef9369aa56adcae7650c9a2f0
Author: Alexander Couzens <lynxis at fe80.eu>
Date:   Sat Oct 8 00:53:09 2016 +0200

    ifdtool: don't write unused regions into a layout file
    
    flashrom treats them as invalid because start > end.
    
    Change-Id: I1c8b4563094823ebd9b1193b91e7b4a748955228
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 util/ifdtool/ifdtool.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index b5b0cd7..594849a 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -296,6 +296,11 @@ static void dump_frba_layout(frba_t * frba, char *layout_fname)
 	}
 
 	for (i = 0; i < max_regions; i++) {
+		region_t region = get_region(frba, i);
+		/* is region invalid? */
+		if (region.size < 1)
+			return;
+
 		dump_region_layout(buf, bufsize, i, frba);
 		if (write(layout_fd, buf, strlen(buf)) < 0) {
 			perror("Could not write to file");



More information about the coreboot-gerrit mailing list