]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: acpi: Add memset to initialize SPCR table
authorWolfgang Wallner <wolfgang.wallner@br-automation.com>
Wed, 16 Sep 2020 14:57:53 +0000 (16:57 +0200)
committerBin Meng <bmeng.cn@gmail.com>
Mon, 21 Sep 2020 08:41:36 +0000 (16:41 +0800)
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>
arch/x86/lib/acpi_table.c

index 6b827bfa3f6901e69309934e9b8037a929ac7c5e..c445aa68703743d3b40c97a68f6e71b01d8adde3 100644 (file)
@@ -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);