diff options
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 6c0bd49cee5f..891d713d9c96 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -1636,4 +1636,25 @@ out_free: | |||
1636 | return -ENOMEM; | 1636 | return -ENOMEM; |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | static void amd_iommu_domain_destroy(struct iommu_domain *dom) | ||
1640 | { | ||
1641 | struct protection_domain *domain = dom->priv; | ||
1642 | |||
1643 | if (!domain) | ||
1644 | return; | ||
1645 | |||
1646 | if (domain->dev_cnt > 0) | ||
1647 | cleanup_domain(domain); | ||
1648 | |||
1649 | BUG_ON(domain->dev_cnt != 0); | ||
1650 | |||
1651 | free_pagetable(domain); | ||
1652 | |||
1653 | domain_id_free(domain->id); | ||
1654 | |||
1655 | kfree(domain); | ||
1656 | |||
1657 | dom->priv = NULL; | ||
1658 | } | ||
1659 | |||
1639 | #endif | 1660 | #endif |