summaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vringh.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-09-16 01:09:39 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2022-11-25 19:01:21 +0100
commite3bf3df824675ea9cadc3cd2c75d08ee83a6ae26 (patch)
tree8381ddc6da23024e256bc78cd71ce570decc2f0e /drivers/vhost/vringh.c
parent[target] fix iov_iter_bvec() "direction" argument (diff)
downloadlinux-e3bf3df824675ea9cadc3cd2c75d08ee83a6ae26.tar.xz
linux-e3bf3df824675ea9cadc3cd2c75d08ee83a6ae26.zip
[vhost] fix 'direction' argument of iov_iter_{init,bvec}()
READ means "data destination", WRITE - "data source". Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--drivers/vhost/vringh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
index 11f59dd06a74..8be8f30a78f7 100644
--- a/drivers/vhost/vringh.c
+++ b/drivers/vhost/vringh.c
@@ -1162,7 +1162,7 @@ static inline int copy_from_iotlb(const struct vringh *vrh, void *dst,
else if (ret < 0)
return ret;
- iov_iter_bvec(&iter, READ, iov, ret, translated);
+ iov_iter_bvec(&iter, WRITE, iov, ret, translated);
ret = copy_from_iter(dst, translated, &iter);
if (ret < 0)
@@ -1195,7 +1195,7 @@ static inline int copy_to_iotlb(const struct vringh *vrh, void *dst,
else if (ret < 0)
return ret;
- iov_iter_bvec(&iter, WRITE, iov, ret, translated);
+ iov_iter_bvec(&iter, READ, iov, ret, translated);
ret = copy_to_iter(src, translated, &iter);
if (ret < 0)