summaryrefslogtreecommitdiff
path: root/sound/x86
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-06-27 14:59:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-08 13:03:35 +0100
commit23df63002205f17d307af118fe0025f6e49d389a (patch)
tree068beceed7e2d91f85b5760c1c9c5e52ebc77df1 /sound/x86
parentaf882cb0bcb5573014e2203dbfd67e2737bb10d3 (diff)
ALSA: intel_hdmi: Use strlcpy() instead of strncpy()
commit c288248f5b26cd5563112fcdc077bf44964a942d upstream. hdmi_lpe_audio_probe() copies the pcm name string via strncpy(), but as a gcc8 warning suggests, it misses a NUL terminator, and unlikely the expected result. Use the proper one, strlcpy() instead. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/x86')
-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 697872d8308e..8b7abbd69116 100644
--- a/sound/x86/intel_hdmi_audio.c
+++ b/sound/x86/intel_hdmi_audio.c
@@ -1839,7 +1839,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;
- strncpy(pcm->name, card->shortname, strlen(card->shortname));
+ strlcpy(pcm->name, card->shortname, strlen(card->shortname));
/* setup the ops for playabck */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &had_pcm_ops);