aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2023-09-25 13:03:00 +0100
committerChristian Brauner <[email protected]>2023-09-25 14:30:27 +0200
commit1fcb71282e732a27b2d1d2003ab24d9f13f26e19 (patch)
treebd5f165e5b9a880922f9e9e7003f41dbc8846cd4
parent066baf92bed934c9fb4bcee97a193f47aa63431c (diff)
sound: Fix snd_pcm_readv()/writev() to use iov access functions
Fix snd_pcm_readv()/writev() to use iov access functions rather than poking at the iov_iter internals directly. Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Jaroslav Kysela <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> cc: Oswald Buddenhagen <[email protected]> cc: Jens Axboe <[email protected]> cc: Suren Baghdasaryan <[email protected]> cc: Kuninori Morimoto <[email protected]> cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
-rw-r--r--sound/core/pcm_native.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index bd9ddf412b46..9a69236fa207 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3527,7 +3527,7 @@ static ssize_t snd_pcm_readv(struct kiocb *iocb, struct iov_iter *to)
if (runtime->state == SNDRV_PCM_STATE_OPEN ||
runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
return -EBADFD;
- if (!to->user_backed)
+ if (!user_backed_iter(to))
return -EINVAL;
if (to->nr_segs > 1024 || to->nr_segs != runtime->channels)
return -EINVAL;
@@ -3567,7 +3567,7 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from)
if (runtime->state == SNDRV_PCM_STATE_OPEN ||
runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
return -EBADFD;
- if (!from->user_backed)
+ if (!user_backed_iter(from))
return -EINVAL;
if (from->nr_segs > 128 || from->nr_segs != runtime->channels ||
!frame_aligned(runtime, iov->iov_len))