|
|
d759b5 |
From f05fe59ebbdfc07d738b393c18f951925dd3814d Mon Sep 17 00:00:00 2001
|
|
|
d759b5 |
Message-Id: <f05fe59ebbdfc07d738b393c18f951925dd3814d@dist-git>
|
|
|
e924b1 |
From: Jiang Kun <jiang.kun2@zte.com.cn>
|
|
|
e924b1 |
Date: Mon, 20 Jan 2020 08:51:25 +0100
|
|
|
e924b1 |
Subject: [PATCH] node_device_conf: Don't leak @physical_function in
|
|
|
e924b1 |
virNodeDeviceGetPCISRIOVCaps
|
|
|
e924b1 |
MIME-Version: 1.0
|
|
|
e924b1 |
Content-Type: text/plain; charset=UTF-8
|
|
|
e924b1 |
Content-Transfer-Encoding: 8bit
|
|
|
e924b1 |
|
|
|
e924b1 |
The pci_dev->physical_function is rewritten in
|
|
|
e924b1 |
virPCIGetPhysicalFunction() to a newly allocated pointer.
|
|
|
e924b1 |
Therefore, we must free the old one to avoid memleak.
|
|
|
e924b1 |
|
|
|
e924b1 |
Signed-off-by: Jiang kun <jiang.kun2@zte.com.cn>
|
|
|
e924b1 |
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
e924b1 |
(cherry picked from commit 38816336a5026623d0a49988c6681b1323c79f09)
|
|
|
e924b1 |
|
|
|
e924b1 |
https://bugzilla.redhat.com/show_bug.cgi?id=1792831
|
|
|
e924b1 |
https://bugzilla.redhat.com/show_bug.cgi?id=1793575
|
|
|
e924b1 |
https://bugzilla.redhat.com/show_bug.cgi?id=1793576
|
|
|
e924b1 |
|
|
|
e924b1 |
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
|
|
e924b1 |
Message-Id: <e0b84a11167f2d4f8e3fa1401959d907921c6df5.1579506302.git.jtomko@redhat.com>
|
|
|
e924b1 |
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
|
|
e924b1 |
---
|
|
|
e924b1 |
src/conf/node_device_conf.c | 1 +
|
|
|
e924b1 |
1 file changed, 1 insertion(+)
|
|
|
e924b1 |
|
|
|
e924b1 |
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
|
|
e924b1 |
index fd8f4e4a94..7f5afee41e 100644
|
|
|
e924b1 |
--- a/src/conf/node_device_conf.c
|
|
|
e924b1 |
+++ b/src/conf/node_device_conf.c
|
|
|
e924b1 |
@@ -2689,6 +2689,7 @@ virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath,
|
|
|
e924b1 |
for (i = 0; i < pci_dev->num_virtual_functions; i++)
|
|
|
e924b1 |
VIR_FREE(pci_dev->virtual_functions[i]);
|
|
|
e924b1 |
VIR_FREE(pci_dev->virtual_functions);
|
|
|
e924b1 |
+ VIR_FREE(pci_dev->physical_function);
|
|
|
e924b1 |
pci_dev->num_virtual_functions = 0;
|
|
|
e924b1 |
pci_dev->max_virtual_functions = 0;
|
|
|
e924b1 |
pci_dev->flags &= ~VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;
|
|
|
e924b1 |
--
|
|
|
e924b1 |
2.25.0
|
|
|
e924b1 |
|