summaryrefslogtreecommitdiff
path: root/drivers/vhost/vhost.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-11-29 21:51:17 +0400
committerDavid S. Miller <davem@davemloft.net>2012-11-29 21:51:17 +0400
commit8a2cf062b27ef5511a7d8a7ce6662fbc04f671b8 (patch)
tree31f32c0d9a548f0dbbe9f3a32aca5767093d98b4 /drivers/vhost/vhost.c
parent3177bf6f922f62743133abbcbbbb5545f4133b2d (diff)
parente9296e89b85604862bd9ec2d54dc43edad775c0d (diff)
downloadlinux-8a2cf062b27ef5511a7d8a7ce6662fbc04f671b8.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/vhost/vhost.c')
-rw-r--r--drivers/vhost/vhost.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index ef8f5988f855..5a3d0f1eaf94 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -1049,7 +1049,7 @@ static int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
}
_iov = iov + ret;
size = reg->memory_size - addr + reg->guest_phys_addr;
- _iov->iov_len = min((u64)len, size);
+ _iov->iov_len = min((u64)len - s, size);
_iov->iov_base = (void __user *)(unsigned long)
(reg->userspace_addr + addr - reg->guest_phys_addr);
s += size;