[PATCH 04/35] fbdev: geode: Use safer strscpy() instead of strcpy()

Ai Chao aichao at kylinos.cn
Fri Apr 24 23:58:55 PDT 2026


Use a safer function strscpy() instead of strcpy() for copying to arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao at kylinos.cn>
---
 drivers/video/fbdev/geode/gx1fb_core.c | 2 +-
 drivers/video/fbdev/geode/gxfb_core.c  | 2 +-
 drivers/video/fbdev/geode/lxfb_core.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/geode/gx1fb_core.c b/drivers/video/fbdev/geode/gx1fb_core.c
index a1919c1934ac..c5a6e3038b98 100644
--- a/drivers/video/fbdev/geode/gx1fb_core.c
+++ b/drivers/video/fbdev/geode/gx1fb_core.c
@@ -274,7 +274,7 @@ static struct fb_info *gx1fb_init_fbinfo(struct device *dev)
 
 	par = info->par;
 
-	strcpy(info->fix.id, "GX1");
+	strscpy(info->fix.id, "GX1");
 
 	info->fix.type		= FB_TYPE_PACKED_PIXELS;
 	info->fix.type_aux	= 0;
diff --git a/drivers/video/fbdev/geode/gxfb_core.c b/drivers/video/fbdev/geode/gxfb_core.c
index 8d69be7c9d31..fe987829315b 100644
--- a/drivers/video/fbdev/geode/gxfb_core.c
+++ b/drivers/video/fbdev/geode/gxfb_core.c
@@ -289,7 +289,7 @@ static struct fb_info *gxfb_init_fbinfo(struct device *dev)
 
 	par = info->par;
 
-	strcpy(info->fix.id, "Geode GX");
+	strscpy(info->fix.id, "Geode GX");
 
 	info->fix.type		= FB_TYPE_PACKED_PIXELS;
 	info->fix.type_aux	= 0;
diff --git a/drivers/video/fbdev/geode/lxfb_core.c b/drivers/video/fbdev/geode/lxfb_core.c
index cad99f5b7fe8..3ae37ec9f151 100644
--- a/drivers/video/fbdev/geode/lxfb_core.c
+++ b/drivers/video/fbdev/geode/lxfb_core.c
@@ -412,7 +412,7 @@ static struct fb_info *lxfb_init_fbinfo(struct device *dev)
 
 	par = info->par;
 
-	strcpy(info->fix.id, "Geode LX");
+	strscpy(info->fix.id, "Geode LX");
 
 	info->fix.type		= FB_TYPE_PACKED_PIXELS;
 	info->fix.type_aux	= 0;
-- 
2.34.1




More information about the linux-arm-kernel mailing list