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 <patrick.rudolph@9elements.com>
diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index 97cd8e8..fc43862 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -615,6 +615,7 @@
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 @@
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 @@
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;