summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-11-21 08:00:27 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-29 09:03:41 +0000
commit5b0db35e0d597a93972c57fa210b1b4935e693ce (patch)
treecfcd8170f46ad4294ea13cf5f4e8675e5a9daa32
parentb6c9a5d797ac5768321292ed649f1626c3596750 (diff)
downloadcoreboot-5b0db35e0d597a93972c57fa210b1b4935e693ce.tar.xz
vendorcode/siemens/hwilib: Fix current file string usage
The CAR_GLOBAL accessors likely hid a bug where strncmp/cpy was passed a pointer to a char array instead of the char array. Change-Id: I68788e47ef27a959d6e048e9385afcfb663cdebc Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37077 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--src/vendorcode/siemens/hwilib/hwilib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vendorcode/siemens/hwilib/hwilib.c b/src/vendorcode/siemens/hwilib/hwilib.c
index 35fb4ce86f..a4b8e547ae 100644
--- a/src/vendorcode/siemens/hwilib/hwilib.c
+++ b/src/vendorcode/siemens/hwilib/hwilib.c
@@ -476,7 +476,7 @@ enum cb_err hwilib_find_blocks (const char *hwi_filename)
return CB_ERR_ARG;
/* Check if this file is already open. If yes, just leave as there is
nothing left to do here. */
- if (!strncmp((char *)&current_hwi, hwi_filename, HWI_MAX_NAME_LEN)) {
+ if (!strncmp(current_hwi, hwi_filename, HWI_MAX_NAME_LEN)) {
printk(BIOS_SPEW, "HWILIB: File \"%s\" already open.\n",
hwi_filename);
return CB_SUCCESS;
@@ -543,7 +543,7 @@ enum cb_err hwilib_find_blocks (const char *hwi_filename)
if (all_blocks[BLK_HIB] || all_blocks[BLK_SIB] || all_blocks[BLK_EIB] ||
all_blocks[BLK_XIB]) {
/* Save currently opened hwi filename. */
- strncpy((char *)&current_hwi, hwi_filename, HWI_MAX_NAME_LEN);
+ strncpy(current_hwi, hwi_filename, HWI_MAX_NAME_LEN);
return CB_SUCCESS;
}
else