Commit e4d3202c authored by Jens Axboe's avatar Jens Axboe

ALSA: pcm: check for user backed iterator, not specific iterator type

In preparation for switching single segment iterators to using ITER_UBUF,
swap the check for whether we are user backed or not.
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent da67ba07
...@@ -3531,7 +3531,7 @@ static ssize_t snd_pcm_readv(struct kiocb *iocb, struct iov_iter *to) ...@@ -3531,7 +3531,7 @@ static ssize_t snd_pcm_readv(struct kiocb *iocb, struct iov_iter *to)
if (runtime->state == SNDRV_PCM_STATE_OPEN || if (runtime->state == SNDRV_PCM_STATE_OPEN ||
runtime->state == SNDRV_PCM_STATE_DISCONNECTED) runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
return -EBADFD; return -EBADFD;
if (!iter_is_iovec(to)) if (!to->user_backed)
return -EINVAL; return -EINVAL;
if (to->nr_segs > 1024 || to->nr_segs != runtime->channels) if (to->nr_segs > 1024 || to->nr_segs != runtime->channels)
return -EINVAL; return -EINVAL;
...@@ -3571,7 +3571,7 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from) ...@@ -3571,7 +3571,7 @@ static ssize_t snd_pcm_writev(struct kiocb *iocb, struct iov_iter *from)
if (runtime->state == SNDRV_PCM_STATE_OPEN || if (runtime->state == SNDRV_PCM_STATE_OPEN ||
runtime->state == SNDRV_PCM_STATE_DISCONNECTED) runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
return -EBADFD; return -EBADFD;
if (!iter_is_iovec(from)) if (!from->user_backed)
return -EINVAL; return -EINVAL;
if (from->nr_segs > 128 || from->nr_segs != runtime->channels || if (from->nr_segs > 128 || from->nr_segs != runtime->channels ||
!frame_aligned(runtime, iov->iov_len)) !frame_aligned(runtime, iov->iov_len))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment