From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
lprosek@redhat.com, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 2/3] virtio-blk: add missing virtio_detach_element() call
Date: Mon, 19 Sep 2016 14:28:04 +0100 [thread overview]
Message-ID: <1474291685-24226-3-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1474291685-24226-1-git-send-email-stefanha@redhat.com>
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>
---
hw/block/virtio-blk.c | 1 +
1 file changed, 1 insertion(+)
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);
}
--
2.7.4
next prev parent reply other threads:[~2016-09-19 13:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 13:28 [Qemu-devel] [PATCH 0/3] virtio: detach VirtQueueElements freed by reset Stefan Hajnoczi
2016-09-19 13:28 ` [Qemu-devel] [PATCH 1/3] virtio: add virtio_detach_element() Stefan Hajnoczi
2016-09-26 8:43 ` Greg Kurz
2016-09-27 7:32 ` Ladi Prosek
2016-09-27 10:08 ` Stefan Hajnoczi
2016-09-27 12:12 ` Ladi Prosek
2016-09-27 15:03 ` Stefan Hajnoczi
2016-09-27 15:24 ` Ladi Prosek
2016-09-19 13:28 ` Stefan Hajnoczi [this message]
2016-09-27 7:49 ` [Qemu-devel] [PATCH 2/3] virtio-blk: add missing virtio_detach_element() call Ladi Prosek
2016-09-27 8:07 ` Greg Kurz
2016-09-19 13:28 ` [Qemu-devel] [PATCH 3/3] virtio-serial: " Stefan Hajnoczi
2016-09-30 10:08 ` Ladi Prosek
2016-09-27 10:08 ` [Qemu-devel] [PATCH 0/3] virtio: detach VirtQueueElements freed by reset Stefan Hajnoczi
2016-10-05 13:12 ` Greg Kurz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474291685-24226-3-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=lprosek@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).