]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: Intel: atom: Replace strcpy() with strscpy()
authorThorsten Blum <thorsten.blum@linux.dev>
Wed, 12 Nov 2025 20:26:25 +0000 (21:26 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 12 Nov 2025 21:49:02 +0000 (21:49 +0000)
strcpy() is deprecated; use the safer strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20251112202630.6277-1-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/atom/sst-atom-controls.c
sound/soc/intel/atom/sst/sst_acpi.c

index c68965f152e8a58fc73dda159a09222224a7b687..ac8e2638a28ec407e08b34ed3cd414860f560c2d 100644 (file)
@@ -142,7 +142,7 @@ static int sst_slot_enum_info(struct snd_kcontrol *kcontrol,
 
        if (uinfo->value.enumerated.item > e->max - 1)
                uinfo->value.enumerated.item = e->max - 1;
-       strcpy(uinfo->value.enumerated.name,
+       strscpy(uinfo->value.enumerated.name,
                e->texts[uinfo->value.enumerated.item]);
 
        return 0;
index 25718063047559f4d34fb4b3e86c07c4c03f1b7d..73624e1b138a65ada40c6672361995313008cda3 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/firmware.h>
@@ -356,7 +357,7 @@ static int sst_acpi_probe(struct platform_device *pdev)
 
        /* Fill sst platform data */
        ctx->pdata = pdata;
-       strcpy(ctx->firmware_name, mach->fw_filename);
+       strscpy(ctx->firmware_name, mach->fw_filename);
 
        ret = sst_platform_get_resources(ctx);
        if (ret)