Skip to content

Commit 93386d3

Browse files
yakuizhaoEddie Dong
authored andcommitted
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>
1 parent 31cb472 commit 93386d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

devicemodel/hw/pci/passthrough.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,7 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts)
815815
break;
816816
}
817817
}
818+
pci_iterator_destroy(iter);
818819

819820
if (error < 0) {
820821
warnx("No physical PCI device %x:%x.%x!", bus, slot, func);

0 commit comments

Comments
 (0)