cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-virtio-scsi-Fix-memory-leak-when-realize-failed.patch

958e1b
From 4595453e4ff31019ccaa9732bbef5106f6d46e6b Mon Sep 17 00:00:00 2001
958e1b
From: Fam Zheng <famz@redhat.com>
958e1b
Date: Tue, 4 Nov 2014 03:06:40 +0100
958e1b
Subject: [PATCH 6/9] virtio-scsi: Fix memory leak when realize failed
958e1b
958e1b
Message-id: <1415070401-21222-3-git-send-email-famz@redhat.com>
958e1b
Patchwork-id: 62061
958e1b
O-Subject: [RHEL-7.1 qemu-kvm PATCH v2 2/3] virtio-scsi: Fix memory leak when realize failed
958e1b
Bugzilla: 1089606
958e1b
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
958e1b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
958e1b
RH-Acked-by: Max Reitz <mreitz@redhat.com>
958e1b
958e1b
Signed-off-by: Fam Zheng <famz@redhat.com>
958e1b
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
958e1b
(cherry picked from commit 93bd49aff9081bbe9440192db9da3676941f77a3)
958e1b
Signed-off-by: Fam Zheng <famz@redhat.com>
958e1b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
958e1b
958e1b
Conflicts:
958e1b
	hw/scsi/virtio-scsi.c
958e1b
Context conflict due to previous patch's resolution.
958e1b
---
958e1b
 hw/scsi/virtio-scsi.c | 1 +
958e1b
 1 file changed, 1 insertion(+)
958e1b
958e1b
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
958e1b
index 73f5ad1..13df89d 100644
958e1b
--- a/hw/scsi/virtio-scsi.c
958e1b
+++ b/hw/scsi/virtio-scsi.c
958e1b
@@ -609,6 +609,7 @@ int virtio_scsi_common_init(VirtIOSCSICommon *s)
958e1b
         error_report("Invalid number of queues (= %" PRId32 "), "
958e1b
                          "must be a positive integer less than %d.",
958e1b
                      s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX);
958e1b
+        virtio_cleanup(vdev);
958e1b
         return -1;
958e1b
     }
958e1b
     s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *));
958e1b
-- 
958e1b
1.8.3.1
958e1b