From 56167c5757e0551a7b03c5109d21a243da932f24 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 22 Jun 2023 23:22:19 +0200 Subject: soc/amd/common/block/acpi/ivrs: zero-initialize ivhd_hpet struct Zero-initialize the ivhd_hpet struct right at the beginning of the ivhd_describe_hpet function to make sure that the whole struct is in a defined state. Signed-off-by: Felix Held Change-Id: If4d3563c485eed4a7cb0526a62f7b6c80f763bfd Reviewed-on: https://review.coreboot.org/c/coreboot/+/76074 Reviewed-by: Jason Glenesk Reviewed-by: Fred Reitberger Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel --- src/soc/amd/common/block/acpi/ivrs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/soc/amd/common/block') diff --git a/src/soc/amd/common/block/acpi/ivrs.c b/src/soc/amd/common/block/acpi/ivrs.c index 7afabf828d..d2080e9f36 100644 --- a/src/soc/amd/common/block/acpi/ivrs.c +++ b/src/soc/amd/common/block/acpi/ivrs.c @@ -36,10 +36,9 @@ static unsigned long acpi_fill_ivrs_ioapic(unsigned long current, void *ioapic_b static unsigned long ivhd_describe_hpet(unsigned long current, uint8_t hndl, uint16_t src_devid) { ivrs_ivhd_special_t *ivhd_hpet = (ivrs_ivhd_special_t *)current; + memset(ivhd_hpet, 0, sizeof(*ivhd_hpet)); ivhd_hpet->type = IVHD_DEV_8_BYTE_EXT_SPECIAL_DEV; - ivhd_hpet->reserved = 0x0000; - ivhd_hpet->dte_setting = 0x00; ivhd_hpet->handle = hndl; ivhd_hpet->source_dev_id = src_devid; /* function 0 of FCH PCI device */ ivhd_hpet->variety = IVHD_SPECIAL_DEV_HPET; -- cgit v1.2.3