]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mips: math-emu: replace deprecated strcpy() in me-debugfs
authorOsama Abdelkader <osama.abdelkader@gmail.com>
Thu, 4 Sep 2025 19:25:25 +0000 (21:25 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 12 Sep 2025 09:56:06 +0000 (11:56 +0200)
use strscpy() instead of deprecated strcpy().

Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/math-emu/me-debugfs.c

index d5ad76b2bb67cb74b90d8bdff064750db4cca6d2..aeddf7aecfc5ea33dae1bcb023c8cb55f3521cae 100644 (file)
@@ -37,11 +37,11 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_fpuemu_stat, fpuemu_stat_get, NULL, "%llu\n");
  * used in debugfs item names to be clearly associated to corresponding
  * MIPS FPU instructions.
  */
-static void adjust_instruction_counter_name(char *out_name, char *in_name)
+static void adjust_instruction_counter_name(char *out_name, char *in_name, size_t len)
 {
        int i = 0;
 
-       strcpy(out_name, in_name);
+       strscpy(out_name, in_name, len);
        while (in_name[i] != '\0') {
                if (out_name[i] == '_')
                        out_name[i] = '.';
@@ -226,7 +226,7 @@ do {                                                                        \
 
 #define FPU_STAT_CREATE_EX(m)                                          \
 do {                                                                   \
-       adjust_instruction_counter_name(name, #m);                      \
+       adjust_instruction_counter_name(name, #m, sizeof(name));                        \
                                                                        \
        debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir,        \
                                (void *)FPU_EMU_STAT_OFFSET(m),         \