summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Zeh <werner.zeh@siemens.com>2016-12-01 10:53:14 +0100
committerWerner Zeh <werner.zeh@siemens.com>2016-12-06 09:59:11 +0100
commit8f91623db98961c4434aa0bdc0195ef848e58975 (patch)
treee6594d9279ef38e89771f26f41a7d220b21961f5
parent425890e59a3e7c9fef4cd98358faa1ea03365580 (diff)
downloadcoreboot-8f91623db98961c4434aa0bdc0195ef848e58975.tar.xz
vendorcode/siemens: Ensure a given info block is available for a field
While searching for a field in all blocks ensure that the checked block is available and can be used. In this way a field can be retrieved from every block and not just the first one. Change-Id: Idbd7656ab0664763cb065f5e817193ad1d9e0871 Signed-off-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-on: https://review.coreboot.org/17670 Tested-by: build bot (Jenkins) Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
-rw-r--r--src/vendorcode/siemens/hwilib/hwilib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vendorcode/siemens/hwilib/hwilib.c b/src/vendorcode/siemens/hwilib/hwilib.c
index 18880ff07e..df9bd2295e 100644
--- a/src/vendorcode/siemens/hwilib/hwilib.c
+++ b/src/vendorcode/siemens/hwilib/hwilib.c
@@ -396,7 +396,8 @@ static uint32_t hwilib_read_bytes (const struct param_info *param, uint8_t *dst,
return 0;
/* Take the first valid block to get the parameter from */
do {
- if ((param->pos[i].len) && (param->pos[i].offset)) {
+ if ((param->pos[i].len) && (param->pos[i].offset) &&
+ (blk_ptr[param->pos[i].blk_type])) {
blk = blk_ptr[param->pos[i].blk_type];
break;
}