Skip to contentSkip to conversation

PNP: Expand length of fixup id string

PATCH Applied Kees Cook 2 participants 2 messages Mar 10, 2025 – Mar 12, 2025

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 PNP: Expand length of fixup id string

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.

---
 include/linux/pnp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pnp.h +1 -1
index b7a7158aaf65..23fe3eaf242d 100644
@@ -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 */
 };
 
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 19 lines · Kees Cook

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.

---
 include/linux/pnp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/pnp.h +0 -0
index b7a7158aaf65..23fe3eaf242d 100644

include/linux/pnp.h static inline void pnp_set_drvdata(struct pnp_dev *pdev, void *data)

Quoted 9 lines
include/linux/pnp.h +1 -2
@@ -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 */
 };
 
--

Applied as 6.15 material, thanks!