acpi: Replace struct acpi_table_slit 1-element array with flex-array
authorWyes Karny <wyes.karny@amd.com>
Tue, 23 May 2023 16:18:15 +0000 (16:18 +0000)
committerKees Cook <keescook@chromium.org>
Thu, 1 Jun 2023 18:24:50 +0000 (11:24 -0700)
struct acpi_table_slit is used for copying System Locality Information
Table data from ACPI tables. Here `entry` is a flex array but it was
using ancient 1-element fake flexible array, which has been deprecated.
Replace it with a C99 flexible array.

Signed-off-by: Wyes Karny <wyes.karny@amd.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Fixes: df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3")
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230523161815.3083-1-wyes.karny@amd.com
include/acpi/actbl3.h

index f51c46f4e3e441cd4ceb0616c06bf627c91a3f83..000764ab398565f71c8139c25981fc6fefdf1aa8 100644 (file)
@@ -86,7 +86,7 @@ struct acpi_table_slic {
 struct acpi_table_slit {
        struct acpi_table_header header;        /* Common ACPI table header */
        u64 locality_count;
-       u8 entry[1];            /* Real size = localities^2 */
+       u8 entry[];                             /* Real size = localities^2 */
 };
 
 /*******************************************************************************