]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PNP: Expand length of fixup id string
authorKees Cook <kees@kernel.org>
Mon, 10 Mar 2025 22:24:33 +0000 (15:24 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Mar 2025 19:41:14 +0000 (20:41 +0100)
GCC 15's -Wunterminated-string-initialization saw that "id" was not
including the required trailing NUL character. Instead of marking "id"
with __nonstring[1], expand the length of the string as it is used in
(debugging) format strings that expect a properly formed C string.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178
Signed-off-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20250310222432.work.826-kees@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/pnp.h

index b7a7158aaf65e37ecbb125f48c8ff822b52e48ff..23fe3eaf242d63e69f13232ca6939a0008efaf57 100644 (file)
@@ -290,7 +290,7 @@ static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)
 }
 
 struct pnp_fixup {
-       char id[7];
+       char id[8];
        void (*quirk_function) (struct pnp_dev *dev);   /* fixup function */
 };