Skip to content

Commit 519b2b1

Browse files
WhiteFox-Projecttiwai
authored andcommitted
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 3e91a38 ("fbdev: viafb: use new array-copying-wrapper"). Signed-off-by: Chenyuan Yang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent d85fc52 commit 519b2b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/core/pcm_native.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3245,7 +3245,7 @@ static int snd_pcm_xfern_frames_ioctl(struct snd_pcm_substream *substream,
32453245
if (copy_from_user(&xfern, _xfern, sizeof(xfern)))
32463246
return -EFAULT;
32473247

3248-
bufs = memdup_user(xfern.bufs, sizeof(void *) * runtime->channels);
3248+
bufs = memdup_array_user(xfern.bufs, runtime->channels, sizeof(void *));
32493249
if (IS_ERR(bufs))
32503250
return PTR_ERR(bufs);
32513251
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)

0 commit comments

Comments
 (0)