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 <yakui.zhao@intel.com>
Reviewed-by: He, Min <min.he@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Zhao Yakui 2019-03-13 14:57:09 +08:00 committed by Eddie Dong
parent 31cb4721e1
commit 93386d3c70

View File

@ -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);