From: Patrick Rudolph Date: Sun, 16 Mar 2025 08:32:54 +0000 (+0100) Subject: acpi: Clear reserved bits in IORT X-Git-Tag: v2025.07-rc1~119^2~10^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe8844f4ad7189a6309976ecc841d55735e3534a;p=thirdparty%2Fu-boot.git acpi: Clear reserved bits in IORT The IORT spec says that reserved bits must be set to zero, thus clear all fields of the struct before starting to fill out non-reserved fields. Signed-off-by: Patrick Rudolph --- diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c index 97cd8e8ddb0..fc43862ec37 100644 --- a/lib/acpi/acpi_table.c +++ b/lib/acpi/acpi_table.c @@ -615,6 +615,7 @@ int acpi_iort_add_named_component(struct acpi_ctx *ctx, node->length += strlen(device_name) + 1; comp = (struct acpi_iort_named_component *)node->node_data; + memset(comp, '\0', sizeof(struct acpi_iort_named_component)); comp->node_flags = node_flags; comp->memory_properties = memory_properties; @@ -655,6 +656,8 @@ int acpi_iort_add_rc(struct acpi_ctx *ctx, node->length += sizeof(struct acpi_iort_id_mapping) * num_mappings; rc = (struct acpi_iort_rc *)node->node_data; + memset(rc, '\0', sizeof(struct acpi_iort_rc)); + rc->mem_access_properties = mem_access_properties; rc->ats_attributes = ats_attributes; rc->pci_segment_number = pci_segment_number; @@ -713,6 +716,7 @@ int acpi_iort_add_smmu_v3(struct acpi_ctx *ctx, node->length += sizeof(struct acpi_iort_id_mapping) * num_mappings; smmu = (struct acpi_iort_smmu_v3 *)node->node_data; + memset(smmu, '\0', sizeof(struct acpi_iort_smmu_v3)); smmu->base_address = base_address; smmu->flags = flags;