All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: Intel: atom: Replace strcpy() with strscpy()
@ 2025-11-12 20:26 Thorsten Blum
  2025-11-13 12:51 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-11-12 20:26 UTC (permalink / raw)
  To: Cezary Rojewski, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Pierre-Louis Bossart, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Kuninori Morimoto
  Cc: Thorsten Blum, linux-sound, linux-kernel

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>
---
Changes in v2:
- Combine both patches and update the patch title
- Link to v1: https://lore.kernel.org/lkml/20251111224706.87508-2-thorsten.blum@linux.dev/
---
 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(-)

diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c
index 38116c758717..799d4f0881e3 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 257180630475..73624e1b138a 100644
--- a/sound/soc/intel/atom/sst/sst_acpi.c
+++ b/sound/soc/intel/atom/sst/sst_acpi.c
@@ -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)
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-13 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-12 20:26 [PATCH v2] ASoC: Intel: atom: Replace strcpy() with strscpy() Thorsten Blum
2025-11-13 12:51 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.