Skip to content

Commit d787415

Browse files
Siddarth Gundutiwai
authored andcommitted
ALSA: dbri: replace strcpy() with strscpy()
strcpy() is deprecated; use strscpy() instead. Both the destination and source buffer are of fixed length so strscpy with 2-arguments is used. Link: KSPP#88 Signed-off-by: Siddarth Gundu <siddarthsgml@gmail.com> Link: https://patch.msgid.link/20250519194833.106463-1-siddarthsgml@gmail.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent b522a8b commit d787415

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sound/sparc/dbri.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include <linux/io.h>
6161
#include <linux/dma-mapping.h>
6262
#include <linux/gfp.h>
63+
#include <linux/string.h>
6364

6465
#include <sound/core.h>
6566
#include <sound/pcm.h>
@@ -2239,7 +2240,7 @@ static int snd_dbri_pcm(struct snd_card *card)
22392240

22402241
pcm->private_data = card->private_data;
22412242
pcm->info_flags = 0;
2242-
strcpy(pcm->name, card->shortname);
2243+
strscpy(pcm->name, card->shortname);
22432244

22442245
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
22452246
NULL, 64 * 1024, 64 * 1024);
@@ -2446,7 +2447,7 @@ static int snd_dbri_mixer(struct snd_card *card)
24462447
return -EINVAL;
24472448
dbri = card->private_data;
24482449

2449-
strcpy(card->mixername, card->shortname);
2450+
strscpy(card->mixername, card->shortname);
24502451

24512452
for (idx = 0; idx < ARRAY_SIZE(dbri_controls); idx++) {
24522453
err = snd_ctl_add(card,
@@ -2613,8 +2614,8 @@ static int dbri_probe(struct platform_device *op)
26132614
if (err < 0)
26142615
return err;
26152616

2616-
strcpy(card->driver, "DBRI");
2617-
strcpy(card->shortname, "Sun DBRI");
2617+
strscpy(card->driver, "DBRI");
2618+
strscpy(card->shortname, "Sun DBRI");
26182619
rp = &op->resource[0];
26192620
sprintf(card->longname, "%s at 0x%02lx:0x%016llx, irq %d",
26202621
card->shortname,

0 commit comments

Comments
 (0)