From f74cf70e5e78a43bd316e5c8e371caea0a49c207 Mon Sep 17 00:00:00 2001 From: Ajith P V Date: Tue, 18 Aug 2026 11:17:22 +0000 Subject: [PATCH] fbdev: viafb: refactor strcpy and viafb_name Eliminate the single-use file-scope variable `viafb_name` and pass the "Via" string literal directly to strcpy(). Since "Via" is a literal constant, the compiler safely executes compile-time bounds checking during fortify verification. This satisfies the security initiative requirements while minimizing code complexity. Signed-off-by: Ajith P V Signed-off-by: Helge Deller --- drivers/video/fbdev/via/viafbdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c index 80f95dac32c8..dd9374e8ad09 100644 --- a/drivers/video/fbdev/via/viafbdev.c +++ b/drivers/video/fbdev/via/viafbdev.c @@ -16,7 +16,6 @@ #define _MASTER_FILE #include "global.h" -static char *viafb_name = "Via"; static u32 pseudo_pal[17]; /* video mode */ @@ -144,7 +143,7 @@ static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix, struct viafb_par *viaparinfo) { memset(fix, 0, sizeof(struct fb_fix_screeninfo)); - strcpy(fix->id, viafb_name); + strcpy(fix->id, "Via"); fix->smem_start = viaparinfo->fbmem; fix->smem_len = viaparinfo->fbmem_free;