From 63a4e6bd7603b2b86835d1e9b29222c0d30d2739 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 22 Jun 2023 23:04:19 +0200 Subject: [PATCH] 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 Change-Id: Ia6750b58dacb9b9192ed21128eb6e3a4495b96d0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76072 Tested-by: build bot (Jenkins) Reviewed-by: Fred Reitberger Reviewed-by: Jason Glenesk --- src/soc/amd/common/block/acpi/ivrs.c | 6 +----- 1 file changed, 1 insertion(+), 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; }