diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-06-22 23:04:19 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-06-23 21:58:51 +0000 |
commit | 63a4e6bd7603b2b86835d1e9b29222c0d30d2739 (patch) | |
tree | 8974391904e0d6b32008e987c0b07c4f1bba09a0 /src | |
parent | 47ed2714c8130456ab666b14eb4b5c6f606d559a (diff) |
soc/amd/common/block/acpi/ivrs: zero-initialize ivhd_f0 struct
Zero-initialize the ivhd_f0 struct right at the beginning of the
ivhd_describe_f0_device function to make sure that the whole struct is
in a defined state.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ia6750b58dacb9b9192ed21128eb6e3a4495b96d0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76072
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/block/acpi/ivrs.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/soc/amd/common/block/acpi/ivrs.c b/src/soc/amd/common/block/acpi/ivrs.c index 79b4ff6375..8d127e9467 100644 --- a/src/soc/amd/common/block/acpi/ivrs.c +++ b/src/soc/amd/common/block/acpi/ivrs.c @@ -52,6 +52,7 @@ static unsigned long ivhd_describe_f0_device(unsigned long current, uint16_t dev_id, uint8_t datasetting) { ivrs_ivhd_f0_entry_t *ivhd_f0 = (ivrs_ivhd_f0_entry_t *)current; + memset(ivhd_f0, 0, sizeof(*ivhd_f0)); ivhd_f0->type = IVHD_DEV_VARIABLE; ivhd_f0->dev_id = dev_id; @@ -65,11 +66,6 @@ static unsigned long ivhd_describe_f0_device(unsigned long current, ivhd_f0->hardware_id[6] = '4'; ivhd_f0->hardware_id[7] = '0'; - memset(ivhd_f0->compatible_id, 0, sizeof(ivhd_f0->compatible_id)); - - ivhd_f0->uuid_format = 0; - ivhd_f0->uuid_length = 0; - current += sizeof(ivrs_ivhd_f0_entry_t); return current; } |