summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-generic-dmaengine-pcm.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2019-09-11 11:33:31 +0300
committerMark Brown <broonie@kernel.org>2019-09-11 15:55:28 +0100
commit48118a9323ab715358bf63f5172c5c2b8cf5f455 (patch)
treed837af004acb61d6f2550c109ed18f66d384f18f /sound/soc/soc-generic-dmaengine-pcm.c
parent73681f4f1426847b421649c6aa6c2dc303acc7c8 (diff)
downloadlinux-48118a9323ab715358bf63f5172c5c2b8cf5f455.tar.gz
linux-48118a9323ab715358bf63f5172c5c2b8cf5f455.tar.bz2
linux-48118a9323ab715358bf63f5172c5c2b8cf5f455.zip
ASoC: dmaengine: Replace strncpy() with strscpy_pad() for pcm->name
While it is safe to use strncpy in this case, the advice is to move to strscpy or strscpy_pad. Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Link: https://lore.kernel.org/r/20190911083331.16801-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-generic-dmaengine-pcm.c')
-rw-r--r--sound/soc/soc-generic-dmaengine-pcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
index d93db2c2b527..5552c66ca642 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -308,9 +308,9 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE;
if (rtd->pcm->streams[i].pcm->name[0] == '\0') {
- strncpy(rtd->pcm->streams[i].pcm->name,
- rtd->pcm->streams[i].pcm->id,
- sizeof(rtd->pcm->streams[i].pcm->name));
+ strscpy_pad(rtd->pcm->streams[i].pcm->name,
+ rtd->pcm->streams[i].pcm->id,
+ sizeof(rtd->pcm->streams[i].pcm->name));
}
}