diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-09-19 14:28:04 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-10-10 01:16:58 +0300 |
commit | 97b93c8ad2242c5a5f89ac50f9e696289c5b4947 (patch) | |
tree | af31ae74d3fa8cdbc39fe55abab6209fe5701d3a /hw | |
parent | 2640d2a5ff08978d67bd87518d05d6b499488c9a (diff) | |
download | qemu-97b93c8ad2242c5a5f89ac50f9e696289c5b4947.zip qemu-97b93c8ad2242c5a5f89ac50f9e696289c5b4947.tar.gz qemu-97b93c8ad2242c5a5f89ac50f9e696289c5b4947.tar.bz2 |
virtio-blk: add missing virtio_detach_element() call
Make sure to unmap the scatter-gather list and decrement vq->inuse
before freeing requests in virtio_blk_reset().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Ladi Prosek <lprosek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/virtio-blk.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 3a6112f..c7ca4d6 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -665,6 +665,7 @@ static void virtio_blk_reset(VirtIODevice *vdev) while (s->rq) { req = s->rq; s->rq = req->next; + virtqueue_detach_element(req->vq, &req->elem, 0); virtio_blk_free_request(req); } |