AMD/IOMMU: free more memory when cleaning up after error

The interrupt remapping in-use bitmaps were leaked in all cases. The
ring buffers and the mapping of the MMIO space were leaked for any IOMMU
that hadn't been enabled yet.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
master commit: 6ae22e7aac
master date: 2019-07-22 11:59:01 +0200
This commit is contained in:
Jan Beulich committed 2019-07-26 11:00:50 +02:00
1 parent d7aeafe7c8
commit 491edac2cb
2 files changed
+7 -6

No files matched your search

+5 -6
View File
@@ -1073,13 +1073,12 @@ static void __init amd_iommu_init_cleanup(void)
{
list_del(&iommu->list);
if ( iommu->enabled )
{
disable_iommu(iommu);
deallocate_ring_buffer(&iommu->cmd_buffer);
deallocate_ring_buffer(&iommu->event_log);
deallocate_ring_buffer(&iommu->ppr_log);
unmap_iommu_mmio_region(iommu);
}
deallocate_ring_buffer(&iommu->cmd_buffer);
deallocate_ring_buffer(&iommu->event_log);
deallocate_ring_buffer(&iommu->ppr_log);
unmap_iommu_mmio_region(iommu);
xfree(iommu);
}
+2
View File
@@ -610,6 +610,8 @@ int __init amd_iommu_free_intremap_table(
{
void *tb = ivrs_mapping->intremap_table;
XFREE(ivrs_mapping->intremap_inuse);
if ( tb )
{
__free_amd_iommu_tables(tb, INTREMAP_TABLE_ORDER);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.