summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Wallner <wolfgang.wallner@br-automation.com>2020-09-16 16:57:53 +0200
committerBin Meng <bmeng.cn@gmail.com>2020-09-21 16:41:36 +0800
commit40edea3a07ebb89e86c9bde8c94000c8f6613be7 (patch)
treebd7cfe7a8248bee4d51e8bfcd7da968816c8efb6
parent3f6966ab2b9a2264c05d699353e61b276b1a85bd (diff)
x86: acpi: Add memset to initialize SPCR table
Add a missing memset to acpi_create_spcr(). The other acpi_create_xxxx() functions perform a memset on their structures, acpi_create_spcr() does not and as a result the contents of this table are partly uninitialized (and thus random after every reset). Fixes: b288cd960072 ("x86: acpi: Generate SPCR table") Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> [bmeng: fix the tags format in the commit message] Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--arch/x86/lib/acpi_table.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
index 6b827bfa3f..c445aa6870 100644
--- a/arch/x86/lib/acpi_table.c
+++ b/arch/x86/lib/acpi_table.c
@@ -252,6 +252,8 @@ static void acpi_create_spcr(struct acpi_spcr *spcr)
int space_id;
int ret = -ENODEV;
+ memset((void *)spcr, 0, sizeof(struct acpi_spcr));
+
/* Fill out header fields */
acpi_fill_header(header, "SPCR");
header->length = sizeof(struct acpi_spcr);