[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v8 07/10] vmxnet3: fix reference leak issue

From: Cao jin
Subject: [Qemu-devel] [PATCH v8 07/10] vmxnet3: fix reference leak issue
Date: Fri, 13 Jan 2017 15:12:01 +0800

On migration target, msix_vector_use() will be called in vmxnet3_post_load()
in second time, without a matching second call to msi_vector_unuse(),
which results in vector reference leak.

CC: Dmitry Fleytman <address@hidden>
CC: Jason Wang <address@hidden>
CC: Markus Armbruster <address@hidden>
CC: Michael S. Tsirkin <address@hidden>

Reviewed-by: Markus Armbruster <address@hidden>
Reviewed-by: Dmitry Fleytman <address@hidden>
Acked-by: Marcel Apfelbaum <address@hidden>
Signed-off-by: Cao jin <address@hidden>
 hw/net/vmxnet3.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index a433cc017cb1..45e125e92c8a 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2552,21 +2552,11 @@ static void vmxnet3_put_rxq_descr(QEMUFile *f, void 
*pv, size_t size)
 static int vmxnet3_post_load(void *opaque, int version_id)
     VMXNET3State *s = opaque;
-    PCIDevice *d = PCI_DEVICE(s);
     net_tx_pkt_init(&s->tx_pkt, PCI_DEVICE(s),
                     s->max_tx_frags, s->peer_has_vhdr);
     net_rx_pkt_init(&s->rx_pkt, s->peer_has_vhdr);
-    if (s->msix_used) {
-        if  (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) {
-            VMW_WRPRN("Failed to re-use MSI-X vectors");
-            msix_uninit(d, &s->msix_bar, &s->msix_bar);
-            s->msix_used = false;
-            return -1;
-        }
-    }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]