Commit b3683dee authored by Jason Wang's avatar Jason Wang Committed by Michael S. Tsirkin

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: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 67715961
...@@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len) ...@@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len)
return 0; 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. * vringh_init_kern - initialize a vringh for a kernelspace vring.
* @vrh: the vringh to initialize. * @vrh: the vringh to initialize.
...@@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern); ...@@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern);
ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov, ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov,
const void *src, size_t len) 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); EXPORT_SYMBOL(vringh_iov_push_kern);
......
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