From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blycP-0006cy-7K for qemu-devel@nongnu.org; Mon, 19 Sep 2016 09:28:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blycJ-0005B7-HU for qemu-devel@nongnu.org; Mon, 19 Sep 2016 09:28:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blycJ-0005B0-Bj for qemu-devel@nongnu.org; Mon, 19 Sep 2016 09:28:15 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D98C33140F7 for ; Mon, 19 Sep 2016 13:28:14 +0000 (UTC) From: Stefan Hajnoczi Date: Mon, 19 Sep 2016 14:28:04 +0100 Message-Id: <1474291685-24226-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1474291685-24226-1-git-send-email-stefanha@redhat.com> References: <1474291685-24226-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] virtio-blk: add missing virtio_detach_element() call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , lprosek@redhat.com, Stefan Hajnoczi Make sure to unmap the scatter-gather list and decrement vq->inuse before freeing requests in virtio_blk_reset(). Signed-off-by: Stefan Hajnoczi --- 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