summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
authorRocky Phagura <rphagura@fb.com>2021-05-21 13:34:03 -0700
committerFelix Held <felix-coreboot@felixheld.de>2021-05-26 12:28:28 +0000
commitb46a9e5ddb3543cbbcfd4b22c3b001e7c7fc73e8 (patch)
tree29240d559b9e8d7aef7860cce4f8b1715b6d7aed /src/acpi
parent07056feba09dc13f5817d708c363ed256a0f94ab (diff)
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 <rphagura@fb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/54787 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Lance Zhao Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpi.c4
1 files changed, 2 insertions, 2 deletions
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,