diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-07-14 22:08:29 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-12-03 03:24:01 +0100 |
commit | 19c5b89d8d582cce9a90335de212cf477fe15b95 (patch) | |
tree | b998b3983df8c51352d4b519cef781246a9f7ba4 /drivers/misc/vmw_vmci | |
parent | Linux 4.15-rc1 (diff) | |
download | linux-19c5b89d8d582cce9a90335de212cf477fe15b95.tar.xz linux-19c5b89d8d582cce9a90335de212cf477fe15b95.zip |
vmci: fix buf_size in case of iovec-based accesses
Both qp_dequeue_locked() and qp_enqueue_locked() use the
buf_size argument to decide how much would be there to copy;
in case of iovec- (== msghdr-)based primitives it's not
iov_size, it's msg_data_left(msg).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/misc/vmw_vmci')
-rw-r--r-- | drivers/misc/vmw_vmci/vmci_queue_pair.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c index 8af5c2672f71..7387dedcda67 100644 --- a/drivers/misc/vmw_vmci/vmci_queue_pair.c +++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c @@ -3253,7 +3253,7 @@ ssize_t vmci_qpair_enquev(struct vmci_qp *qpair, result = qp_enqueue_locked(qpair->produce_q, qpair->consume_q, qpair->produce_q_size, - msg, iov_size, + msg, msg_data_left(msg), qp_memcpy_to_queue_iov); if (result == VMCI_ERROR_QUEUEPAIR_NOT_READY && @@ -3295,7 +3295,7 @@ ssize_t vmci_qpair_dequev(struct vmci_qp *qpair, result = qp_dequeue_locked(qpair->produce_q, qpair->consume_q, qpair->consume_q_size, - msg, iov_size, + msg, msg_data_left(msg), qp_memcpy_from_queue_iov, true); @@ -3339,7 +3339,7 @@ ssize_t vmci_qpair_peekv(struct vmci_qp *qpair, result = qp_dequeue_locked(qpair->produce_q, qpair->consume_q, qpair->consume_q_size, - msg, iov_size, + msg, msg_data_left(msg), qp_memcpy_from_queue_iov, false); |