From 93386d3c70692916b2af63279cee50643ac1a9fb Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Wed, 13 Mar 2019 14:57:09 +0800 Subject: [PATCH] ACRN/DM: Destroy the created pci_device iterator to fix memory leak in passthru_init Now it will call the below function to create the corresponding pci_device_iterator in passthrough device initialization. But it is not released in time. So it needs to be released to fix the memory leak issue. Tracked-On: #2762 Signed-off-by: Zhao Yakui Reviewed-by: He, Min Acked-by: Yin Fengwei --- devicemodel/hw/pci/passthrough.c | 1 + 1 file changed, 1 insertion(+) diff --git a/devicemodel/hw/pci/passthrough.c b/devicemodel/hw/pci/passthrough.c index be26b84d2..efef7314f 100644 --- a/devicemodel/hw/pci/passthrough.c +++ b/devicemodel/hw/pci/passthrough.c @@ -815,6 +815,7 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) break; } } + pci_iterator_destroy(iter); if (error < 0) { warnx("No physical PCI device %x:%x.%x!", bus, slot, func);