[PATCH 19/35] fbdev: savage: Use safer strscpy() instead of strcpy()

From
Ai Chao <hidden>
Date
2026-04-25 07:00:29
Also in
dri-devel, linux-arm-kernel, lkml
Reply to
Ai Chao, 2026-04-25
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 <redacted>
---
 drivers/video/fbdev/savage/savagefb-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/savage/savagefb-i2c.c b/drivers/video/fbdev/savage/savagefb-i2c.c
index 80fa87e2ae2f..820d1f83669d 100644
--- a/drivers/video/fbdev/savage/savagefb-i2c.c
+++ b/drivers/video/fbdev/savage/savagefb-i2c.c
@@ -136,7 +136,7 @@ static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan,
 	int rc = 0;
 
 	if (chan->par) {
-		strcpy(chan->adapter.name, name);
+		strscpy(chan->adapter.name, name);
 		chan->adapter.owner		= THIS_MODULE;
 		chan->adapter.algo_data		= &chan->algo;
 		chan->adapter.dev.parent	= &chan->par->pcidev->dev;
-- 
2.34.1
Thread (22 messages) 22 messages, 3 authors, last reply 2026-04-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help