]> www.infradead.org Git - qemu-nvme.git/commit
vfio: Fix memory leak of hostwin
authorPeng Liang <liangpeng10@huawei.com>
Wed, 17 Nov 2021 01:47:39 +0000 (09:47 +0800)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 17 Nov 2021 18:25:55 +0000 (11:25 -0700)
commitf3bc3a73c908df15966e66f88d5a633bd42fd029
tree5cb488903ab08148ca94ce3b32d0caf43a36309f
parent3bb87484e77d22cf4e580a78856529c982195d32
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>
hw/vfio/common.c