aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio
diff options
context:
space:
mode:
authorJia He <hejianet@gmail.com>2018-02-28 01:35:29 -0800
committerMichael S. Tsirkin <mst@redhat.com>2018-03-01 18:17:47 +0200
commit9fac50c88d91ebf7a7d3d31f8520762ac24e12b9 (patch)
treed386cfe618953aa78151c5624726548b5771b327 /hw/virtio
parentfb20fbb764aa1eb3014c7544ea3daa58bc7b4cd2 (diff)
vhost: fix incorrect check in vhost_verify_ring_mappings
In commit 0ca1fd2d6878 ("vhost: Simplify ring verification checks"), it checks the virtqueue desc mapping for 3 times. Fixed: commit 0ca1fd2d6878 ("vhost: Simplify ring verification checks") Signed-off-by: Jia He <jia.he@hxt-semitech.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'hw/virtio')
-rw-r--r--hw/virtio/vhost.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index d02d12a861..d8d0ef92e1 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -359,7 +359,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
j++;
r = vhost_verify_ring_part_mapping(
- vq->desc, vq->desc_phys, vq->desc_size,
+ vq->avail, vq->avail_phys, vq->avail_size,
reg_hva, reg_gpa, reg_size);
if (r) {
break;
@@ -367,7 +367,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev,
j++;
r = vhost_verify_ring_part_mapping(
- vq->desc, vq->desc_phys, vq->desc_size,
+ vq->used, vq->used_phys, vq->used_size,
reg_hva, reg_gpa, reg_size);
if (r) {
break;