]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: sni: Replace deprecated strcpy() in sni_console_setup()
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 17 Aug 2025 18:37:13 +0000 (20:37 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 29 Aug 2025 20:34:30 +0000 (22:34 +0200)
strcpy() is deprecated; use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Justin Stitt <justinstitt@google.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/sni/setup.c

index 03cb69937258067d836d2769f57b7abf6e7b779f..fc7da12284f5c70be1b52b0a130f0853b3650c4f 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/export.h>
 #include <linux/console.h>
 #include <linux/screen_info.h>
+#include <linux/string.h>
 
 #ifdef CONFIG_FW_ARC
 #include <asm/fw/arc/types.h>
@@ -80,7 +81,7 @@ static void __init sni_console_setup(void)
                        break;
                }
                if (baud)
-                       strcpy(options, baud);
+                       strscpy(options, baud);
                if (strncmp(cdev, "tty552", 6) == 0)
                        add_preferred_console("ttyS", port,
                                              baud ? options : NULL);