mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 06:29:06 -04:00
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 <ajithpv.linux@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user