]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hdspm: Use safer strscpy() instead of strcpy()
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Jul 2025 10:07:03 +0000 (12:07 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 11 Jul 2025 07:53:22 +0000 (09:53 +0200)
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-82-tiwai@suse.de
sound/pci/rme9652/hdspm.c

index 2041cf00cca0c1e1c7ee1e12c9c48ab67e423170..a0976824bedaaeaa2ccd0f8cfcbae412bf04e951 100644 (file)
@@ -6355,7 +6355,7 @@ static int snd_hdspm_create_hwdep(struct snd_card *card,
 
        hdspm->hwdep = hw;
        hw->private_data = hdspm;
-       strcpy(hw->name, "HDSPM hwdep interface");
+       strscpy(hw->name, "HDSPM hwdep interface");
 
        hw->ops.open = snd_hdspm_hwdep_dummy_op;
        hw->ops.ioctl = snd_hdspm_hwdep_ioctl;
@@ -6412,7 +6412,7 @@ static int snd_hdspm_create_pcm(struct snd_card *card,
 
        hdspm->pcm = pcm;
        pcm->private_data = hdspm;
-       strcpy(pcm->name, hdspm->card_name);
+       strscpy(pcm->name, hdspm->card_name);
 
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
                        &snd_hdspm_ops);
@@ -6512,8 +6512,8 @@ static int snd_hdspm_create(struct snd_card *card,
        pci_read_config_word(hdspm->pci,
                        PCI_CLASS_REVISION, &hdspm->firmware_rev);
 
-       strcpy(card->mixername, "Xilinx FPGA");
-       strcpy(card->driver, "HDSPM");
+       strscpy(card->mixername, "Xilinx FPGA");
+       strscpy(card->driver, "HDSPM");
 
        switch (hdspm->firmware_rev) {
        case HDSPM_RAYDAT_REV: