[PATCH 18/35] fbdev: sh7760fb: Use safer strscpy() instead of strcpy()

Ai Chao aichao at kylinos.cn
Fri Apr 24 23:59:09 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/sh7760fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sh7760fb.c b/drivers/video/fbdev/sh7760fb.c
index 130adef2e468..acd70dff3a65 100644
--- a/drivers/video/fbdev/sh7760fb.c
+++ b/drivers/video/fbdev/sh7760fb.c
@@ -508,7 +508,7 @@ static int sh7760fb_probe(struct platform_device *pdev)
 	info->var.transp.length = 0;
 	info->var.transp.msb_right = 0;
 
-	strcpy(info->fix.id, "sh7760-lcdc");
+	strscpy(info->fix.id, "sh7760-lcdc");
 
 	/* set the DON2 bit now, before cmap allocation, as it will randomize
 	 * palette memory.
-- 
2.34.1




More information about the linux-arm-kernel mailing list