diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/vhost/vhost.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index acabf20b069e..36ca2cf419bf 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
| @@ -2071,10 +2071,8 @@ static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len, | |||
| 2071 | _iov = iov + ret; | 2071 | _iov = iov + ret; |
| 2072 | size = node->size - addr + node->start; | 2072 | size = node->size - addr + node->start; |
| 2073 | _iov->iov_len = min((u64)len - s, size); | 2073 | _iov->iov_len = min((u64)len - s, size); |
| 2074 | _iov->iov_base = (void __user *) | 2074 | _iov->iov_base = (void __user *)(unsigned long) |
| 2075 | ((unsigned long)node->userspace_addr + | 2075 | (node->userspace_addr + addr - node->start); |
| 2076 | array_index_nospec((unsigned long)(addr - node->start), | ||
| 2077 | node->size)); | ||
| 2078 | s += size; | 2076 | s += size; |
| 2079 | addr += size; | 2077 | addr += size; |
| 2080 | ++ret; | 2078 | ++ret; |
