summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChenyuan Yang <chenyuan0y@gmail.com>2025-01-27 10:06:55 -0600
committerTakashi Iwai <tiwai@suse.de>2025-01-28 08:48:08 +0100
commit519b2b14bef70922bd64117a978ea7f2a683b75b (patch)
treef5464e1645dc99abcc31671713afc8ca035a3825
parentd85fc52cbb9a719c8335d93a28d6a79d7acd419f (diff)
ALSA: pcm: use new array-copying-wrapper
This is found by our static analysis tool. pcm_native.c utilizes memdup_user() to copy an array from userspace. There is a new wrapper, specifically designed for copying arrays. Use this one instead. This is similar to the commit 3e91a38de1dc ("fbdev: viafb: use new array-copying-wrapper"). Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com> Link: https://patch.msgid.link/20250127160655.3119470-1-cy1yang@outlook.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/core/pcm_native.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 8a3384342e8d..6c2b6a62d9d2 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3245,7 +3245,7 @@ static int snd_pcm_xfern_frames_ioctl(struct snd_pcm_substream *substream,
if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
return -EFAULT;
- bufs = memdup_user(xfern.bufs, sizeof(void *) * runtime->channels);
+ bufs = memdup_array_user(xfern.bufs, runtime->channels, sizeof(void *));
if (IS_ERR(bufs))
return PTR_ERR(bufs);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)