]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio: decrement vq->inuse in virtqueue_discard()
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 Aug 2016 12:54:16 +0000 (13:54 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 8 Sep 2016 19:46:16 +0000 (14:46 -0500)
commitca86c04717c23b2155a9366522736995bc9bd772
tree721427e0b53da8b9f2608ccb08bb83077e95bcca
parent8e44714fe9f471474a439cafaaa386ffbddfa24a
virtio: decrement vq->inuse in virtqueue_discard()

virtqueue_discard() moves vq->last_avail_idx back so the element can be
popped again.  It's necessary to decrement vq->inuse to avoid "leaking"
the element count.

Cc: qemu-stable@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 58a83c61496eeb0d31571a07a51bc1947e3379ac)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/virtio/virtio.c