[coreboot-gerrit] Change in coreboot[master]: util/ifdtool: Fix region limitation check

Youness Alaoui (Code Review) gerrit at coreboot.org
Wed Oct 11 20:13:12 CEST 2017


Youness Alaoui has uploaded this change for review. ( https://review.coreboot.org/21962


Change subject: util/ifdtool: Fix region limitation check
......................................................................

util/ifdtool: Fix region limitation check

Using ifdtool to change layout on a 'ifd v2' file causes an error
about region type 5 not being valid.
The limit to check against is dynamic depending on ifd version, not
static.

Change-Id: Id4cdce4eac18fb0d171d1bdfa2044340bf93056a
Signed-off-by: Youness Alaoui <youness.alaoui at puri.sm>
---
M util/ifdtool/ifdtool.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/21962/1

diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c
index 645175e..8397f5c 100644
--- a/util/ifdtool/ifdtool.c
+++ b/util/ifdtool/ifdtool.c
@@ -171,7 +171,7 @@
 
 	limit_mask = base_mask << 16;
 
-	if (region_type >= MAX_REGIONS) {
+	if (region_type >= max_regions) {
 		fprintf(stderr, "Invalid region type %d.\n", region_type);
 		exit (EXIT_FAILURE);
 	}
@@ -190,7 +190,7 @@
 static void set_region(frba_t *frba, unsigned int region_type,
 		       const region_t *region)
 {
-	if (region_type >= MAX_REGIONS_OLD) {
+	if (region_type >= max_regions) {
 		fprintf(stderr, "Invalid region type %u.\n", region_type);
 		exit (EXIT_FAILURE);
 	}

-- 
To view, visit https://review.coreboot.org/21962
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4cdce4eac18fb0d171d1bdfa2044340bf93056a
Gerrit-Change-Number: 21962
Gerrit-PatchSet: 1
Gerrit-Owner: Youness Alaoui <snifikino at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171011/e965e41d/attachment-0001.html>


More information about the coreboot-gerrit mailing list