]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio: Fix memory leak of hostwin
authorPeng Liang <liangpeng10@huawei.com>
Wed, 17 Nov 2021 01:47:39 +0000 (09:47 +0800)
committerMichael Roth <michael.roth@amd.com>
Tue, 14 Dec 2021 20:49:55 +0000 (14:49 -0600)
commit8c2d5911debfd00a7e8b3d8989c23e892c872043
tree20471850f6786ba6223fd5cde81f1f579c5da971
parent08e46e6d92b979743f4f0fb36e587b5e75a0bde6
vfio: Fix memory leak of hostwin

hostwin is allocated and added to hostwin_list in vfio_host_win_add, but
it is only deleted from hostwin_list in vfio_host_win_del, which causes
a memory leak.  Also, freeing all elements in hostwin_list is missing in
vfio_disconnect_container.

Fix: 2e4109de8e58 ("vfio/spapr: Create DMA window dynamically (SPAPR IOMMU v2)")
CC: qemu-stable@nongnu.org
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Link: https://lore.kernel.org/r/20211117014739.1839263-1-liangpeng10@huawei.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
(cherry picked from commit f3bc3a73c908df15966e66f88d5a633bd42fd029)
Signed-off-by: Michael Roth <michael.roth@amd.com>
hw/vfio/common.c