From b46a9e5ddb3543cbbcfd4b22c3b001e7c7fc73e8 Mon Sep 17 00:00:00 2001 From: Rocky Phagura Date: Fri, 21 May 2021 13:34:03 -0700 Subject: acpi/acpi: fix invalid checksum Incorrect size of the einj structure was being used, which created an invalid checksum message by the OS. This patch fixes the issue. Test=Booted to Linux on Deltalake mainboard and verified invalid checksum message is not logged in syslog. Exact message -> 'ACPI BIOS Warning (bug): Incorrect checksum in table [EINJ] - 0xDA, should be 0xD9' Change-Id: I2b1722d6960d4a62d14fb02ac5e8838397e12f92 Signed-off-by: Rocky Phagura Reviewed-on: https://review.coreboot.org/c/coreboot/+/54787 Reviewed-by: Tim Wawrzynczak Reviewed-by: Lance Zhao Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/acpi/acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 35c5ec3602..6c1828aba4 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -956,7 +956,7 @@ void acpi_create_einj(acpi_einj_t *einj, uintptr_t addr, u8 actions) printk(BIOS_DEBUG, "default_actions[%d].reg.addr is %llx\n", i, default_actions[i].reg.addr); - memset((void *)einj, 0, sizeof(einj)); + memset((void *)einj, 0, sizeof(*einj)); /* Fill out header fields. */ memcpy(header->signature, "EINJ", 4); @@ -973,7 +973,7 @@ void acpi_create_einj(acpi_einj_t *einj, uintptr_t addr, u8 actions) printk(BIOS_DEBUG, "%s einj->action_table = %p\n", __func__, einj->action_table); memcpy((void *)einj->action_table, (void *)default_actions, sizeof(einj->action_table)); - header->checksum = acpi_checksum((void *)einj, sizeof(einj)); + header->checksum = acpi_checksum((void *)einj, sizeof(*einj)); } void acpi_create_vfct(const struct device *device, -- cgit v1.2.3