From: Thorsten Blum Date: Wed, 12 Nov 2025 20:26:25 +0000 (+0100) Subject: ASoC: Intel: atom: Replace strcpy() with strscpy() X-Git-Tag: v6.19-rc1~156^2~3^2~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=123cd174a3782307787268adf45f22de4d290128;p=thirdparty%2Fkernel%2Flinux.git ASoC: Intel: atom: Replace strcpy() with strscpy() strcpy() is deprecated; use the safer strscpy() instead. Link: https://github.com/KSPP/linux/issues/88 Reviewed-by: Cezary Rojewski Signed-off-by: Thorsten Blum Link: https://patch.msgid.link/20251112202630.6277-1-thorsten.blum@linux.dev Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index c68965f152e8a..ac8e2638a28ec 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -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; diff --git a/sound/soc/intel/atom/sst/sst_acpi.c b/sound/soc/intel/atom/sst/sst_acpi.c index 2571806304755..73624e1b138a6 100644 --- a/sound/soc/intel/atom/sst/sst_acpi.c +++ b/sound/soc/intel/atom/sst/sst_acpi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -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)