]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: generic: Replace deprecated strcpy() in ocelot_detect()
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 17 Aug 2025 18:37:18 +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>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/generic/board-ocelot.c

index 7115410acb4fef4528882c6057583f28e0a6fe8b..59a0fb2435824bc1ef5e9475b2bad4ebcb2d3a39 100644 (file)
@@ -4,6 +4,7 @@
  *
  * Copyright (c) 2017 Microsemi Corporation
  */
+#include <linux/string.h>
 #include <asm/machine.h>
 #include <asm/prom.h>
 
@@ -41,7 +42,7 @@ static __init bool ocelot_detect(void)
 
                if (prom_argc > 1 && strlen(prom_argv[1]) > 0)
                        /* ignore all built-in args if any f/w args given */
-                       strcpy(arcs_cmdline, prom_argv[1]);
+                       strscpy(arcs_cmdline, prom_argv[1]);
        }
 
        return true;