diff options
author | Jason Wang <jasowang@redhat.com> | 2019-10-24 05:57:18 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2019-10-28 09:25:04 +0100 |
commit | b3683dee840274e9997d958b9d82e5de95950f0b (patch) | |
tree | fbb7bcc9bbe581c12aab4026e53e685458187af3 /drivers/vhost | |
parent | vsock/virtio: remove unused 'work' field from 'struct virtio_vsock_pkt' (diff) | |
download | linux-b3683dee840274e9997d958b9d82e5de95950f0b.tar.xz linux-b3683dee840274e9997d958b9d82e5de95950f0b.zip |
vringh: fix copy direction of vringh_iov_push_kern()
We want to copy from iov to buf, so the direction was wrong.
Note: no real user for the helper, but it will be used by future
features.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/vringh.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 08ad0d1f0476..a0a2d74967ef 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len) return 0; } +static inline int kern_xfer(void *dst, void *src, size_t len) +{ + memcpy(dst, src, len); + return 0; +} + /** * vringh_init_kern - initialize a vringh for a kernelspace vring. * @vrh: the vringh to initialize. @@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, const void *src, size_t len) { - return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern); + return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer); } EXPORT_SYMBOL(vringh_iov_push_kern); |