cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ddf19c
From 901e65fa6ccbadeacd6c585cf49a0a7cdafb4737 Mon Sep 17 00:00:00 2001
ddf19c
From: Julia Suvorova <jusual@redhat.com>
ddf19c
Date: Wed, 19 Feb 2020 21:34:29 +0000
ddf19c
Subject: [PATCH 5/7] virtio: make virtio_delete_queue idempotent
ddf19c
ddf19c
RH-Author: Julia Suvorova <jusual@redhat.com>
ddf19c
Message-id: <20200219213431.11913-3-jusual@redhat.com>
ddf19c
Patchwork-id: 93981
ddf19c
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH 2/4] virtio: make virtio_delete_queue idempotent
ddf19c
Bugzilla: 1791590
ddf19c
RH-Acked-by: Danilo de Paula <ddepaula@redhat.com>
ddf19c
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
ddf19c
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
ddf19c
ddf19c
From: "Michael S. Tsirkin" <mst@redhat.com>
ddf19c
ddf19c
Let's make sure calling this twice is harmless -
ddf19c
no known instances, but seems safer.
ddf19c
ddf19c
Suggested-by: Pan Nengyuan <pannengyuan@huawei.com>
ddf19c
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
ddf19c
(cherry picked from commit 8cd353ea0fbf0e334e015d833f612799be642296)
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 hw/virtio/virtio.c | 1 +
ddf19c
 1 file changed, 1 insertion(+)
ddf19c
ddf19c
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
ddf19c
index d63a369..e6a9ba4 100644
ddf19c
--- a/hw/virtio/virtio.c
ddf19c
+++ b/hw/virtio/virtio.c
ddf19c
@@ -2342,6 +2342,7 @@ void virtio_delete_queue(VirtQueue *vq)
ddf19c
     vq->handle_output = NULL;
ddf19c
     vq->handle_aio_output = NULL;
ddf19c
     g_free(vq->used_elems);
ddf19c
+    vq->used_elems = NULL;
ddf19c
 }
ddf19c
 
ddf19c
 void virtio_del_queue(VirtIODevice *vdev, int n)
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c