Skip to content

Commit b3683de

Browse files
jasowangmstsirkin
authored andcommitted
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 <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 6771596 commit b3683de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/vhost/vringh.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,12 @@ static inline int xfer_kern(void *src, void *dst, size_t len)
852852
return 0;
853853
}
854854

855+
static inline int kern_xfer(void *dst, void *src, size_t len)
856+
{
857+
memcpy(dst, src, len);
858+
return 0;
859+
}
860+
855861
/**
856862
* vringh_init_kern - initialize a vringh for a kernelspace vring.
857863
* @vrh: the vringh to initialize.
@@ -958,7 +964,7 @@ EXPORT_SYMBOL(vringh_iov_pull_kern);
958964
ssize_t vringh_iov_push_kern(struct vringh_kiov *wiov,
959965
const void *src, size_t len)
960966
{
961-
return vringh_iov_xfer(wiov, (void *)src, len, xfer_kern);
967+
return vringh_iov_xfer(wiov, (void *)src, len, kern_xfer);
962968
}
963969
EXPORT_SYMBOL(vringh_iov_push_kern);
964970

0 commit comments

Comments
 (0)