Skip to contentSkip to conversation

ASoC: Intel: atom: Replace strcpy() with strscpy()

PATCH In review Thorsten Blum 2 participants 2 messages Nov 12, 2025 – Nov 13, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: Intel: atom: Replace strcpy() with strscpy()

strcpy() is deprecated; use the safer strscpy() instead.

---
Changes in v2:
- Combine both patches and update the patch title
- Link to v1: https://lore.kernel.org/lkml/[email protected]/

---
 sound/soc/intel/atom/sst-atom-controls.c | 2 +-
 sound/soc/intel/atom/sst/sst_acpi.c      | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/intel/atom/sst-atom-controls.c +1 -1
index 38116c758717..799d4f0881e3 100644
@@ -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;
sound/soc/intel/atom/sst/sst_acpi.c +2 -1
index 257180630475..73624e1b138a 100644
@@ -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)
Signature · 1 line
2.51.1
maintainer
#1 lore raw
Quoted 3 lines · Thorsten Blum

strcpy() is deprecated; use the safer strscpy() instead.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: Intel: atom: Replace strcpy() with strscpy()

      commit: 123cd174a3782307787268adf45f22de4d290128

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark