]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: Use vhost_get_used_size() in vhost_vring_set_addr()
authorGreg Kurz <groug@kaod.org>
Sat, 3 Oct 2020 10:02:03 +0000 (12:02 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 4 Oct 2020 07:44:25 +0000 (03:44 -0400)
commitd26e9e3281dd9ecc4179e6b2e5eeb2dc947efd66
tree4ca2925d23f07106e6620943448cd3cb6b9a4ac0
parentee57f97f9034276cd945c7a75c610588feec466e
vhost: Use vhost_get_used_size() in vhost_vring_set_addr()

The open-coded computation of the used size doesn't take the event
into account when the VIRTIO_RING_F_EVENT_IDX feature is present.
Fix that by using vhost_get_used_size().

Fixes: 0f36ad30477f ("vhost: support event index")
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kurz <groug@kaod.org>
Link: https://lore.kernel.org/r/160171932300.284610.11846106312938909461.stgit@bahia.lan
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vhost.c