[PATCH 1/1] acpi: fix initial RSDT and XSDT size
Heinrich Schuchardt
heinrich.schuchardt at canonical.com
Mon Apr 20 18:47:25 CEST 2026
When creating the RSDT and the XSDT table they contain no entries.
The table size therefore must equal the header size.
Without this change a NULL deference has been observed in
acpi_find_table() when running `ut dm` on sandbox64_defconfig
executed via `sudo ./u-boot -D`.
Fixes: 94ba15a3f13f ("x86: Move base tables to a writer function")
Fixes: 7e586f69070d ("acpi: Put table-setup code in its own function")
Fixes: ab5efd576c4e ("x86: acpi: Adjust order in acpi_table.c")
Fixes: 867bcb63e79f ("x86: Generate a valid ACPI table")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
lib/acpi/base.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/acpi/base.c b/lib/acpi/base.c
index 5c755b14c16..01ebad8994a 100644
--- a/lib/acpi/base.c
+++ b/lib/acpi/base.c
@@ -44,7 +44,7 @@ static void acpi_write_rsdt(struct acpi_rsdt *rsdt)
/* Fill out header fields */
acpi_fill_header(header, "RSDT");
- header->length = sizeof(struct acpi_rsdt);
+ header->length = sizeof(struct acpi_table_header);
header->revision = 1;
/* Entries are filled in later, we come with an empty set */
@@ -59,7 +59,7 @@ static void acpi_write_xsdt(struct acpi_xsdt *xsdt)
/* Fill out header fields */
acpi_fill_header(header, "XSDT");
- header->length = sizeof(struct acpi_xsdt);
+ header->length = sizeof(struct acpi_table_header);
header->revision = 1;
/* Entries are filled in later, we come with an empty set */
--
2.53.0
More information about the U-Boot
mailing list