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>
This commit is contained in:
parent
2640d2a5ff
commit
97b93c8ad2
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user