Skip to content

Commit

Permalink
vhost: fix incorrect check in vhost_verify_ring_mappings
Browse files Browse the repository at this point in the history
In commit 0ca1fd2 ("vhost: Simplify ring verification checks"),
it checks the virtqueue desc mapping for 3 times.

Fixed: commit 0ca1fd2 ("vhost: Simplify ring verification checks")
Signed-off-by: Jia He <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
hejianet authored and mstsirkin committed Mar 1, 2018
1 parent fb20fbb commit 9fac50c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/virtio/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@ 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;
}

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;
Expand Down

0 comments on commit 9fac50c

Please sign in to comment.