OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73681f4
)
ASoC: dmaengine: Replace strncpy() with strscpy_pad() for pcm->name
author
Peter Ujfalusi
<peter.ujfalusi@ti.com>
Wed, 11 Sep 2019 08:33:31 +0000
(11:33 +0300)
committer
Mark Brown
<broonie@kernel.org>
Wed, 11 Sep 2019 14:55:28 +0000
(15:55 +0100)
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>
sound/soc/soc-generic-dmaengine-pcm.c
patch
|
blob
|
history
diff --git
a/sound/soc/soc-generic-dmaengine-pcm.c
b/sound/soc/soc-generic-dmaengine-pcm.c
index
d93db2c
..
5552c66
100644
(file)
--- 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') {
- str
ncpy
(rtd->pcm->streams[i].pcm->name,
- rtd->pcm->streams[i].pcm->id,
- sizeof(rtd->pcm->streams[i].pcm->name));
+ str
scpy_pad
(rtd->pcm->streams[i].pcm->name,
+
rtd->pcm->streams[i].pcm->id,
+
sizeof(rtd->pcm->streams[i].pcm->name));
}
}