summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-08-06 01:41:53 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-15 12:05:13 +0200
commitd34479bbe810f3c62629b8b2976d154af885447c (patch)
tree6e6b96cd7df8ad770c090db98190552fcee389a7
parent1fec416c03d0a64cc21aa04ce4aa14254b017e6a (diff)
downloadlinux-d34479bbe810f3c62629b8b2976d154af885447c.tar.gz
linux-d34479bbe810f3c62629b8b2976d154af885447c.tar.bz2
linux-d34479bbe810f3c62629b8b2976d154af885447c.zip
ALSA: intel_hdmi: Fix off-by-one error in __hdmi_lpe_audio_probe()
commit 8cbe564974248ee980562be02f2b1912769562c7 upstream. In __hdmi_lpe_audio_probe(), strscpy() is incorrectly called with the length of the source string (excluding the NUL terminator) rather than the size of the destination buffer. This results in one character less being copied from 'card->shortname' to 'pcm->name'. Use the destination buffer size instead to ensure the card name is copied correctly. Cc: stable@vger.kernel.org Fixes: 75b1a8f9d62e ("ALSA: Convert strlcpy to strscpy when return value is unused") Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20250805234156.60294-1-thorsten.blum@linux.dev Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/x86/intel_hdmi_audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c
index ab95fb34a635..7b9292cf839f 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1766,7 +1766,7 @@ static int __hdmi_lpe_audio_probe(struct platform_device *pdev)
/* setup private data which can be retrieved when required */
pcm->private_data = ctx;
pcm->info_flags = 0;
- strscpy(pcm->name, card->shortname, strlen(card->shortname));
+ strscpy(pcm->name, card->shortname, sizeof(pcm->name));
/* setup the ops for playback */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &had_pcm_ops);