aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/iommu
diff options
context:
space:
mode:
authorVasant Hegde <vasant.hegde@amd.com>2022-09-12 06:32:46 +0000
committerJoerg Roedel <jroedel@suse.de>2022-09-26 13:26:39 +0200
commit2455d6a46c2da5703752772f49d56142ccd50463 (patch)
treeae7de1cc7152cb67c6f539c6548871f1fa54cd74 /drivers/iommu
parentiommu/amd: Free domain id in error path (diff)
downloadwireguard-linux-2455d6a46c2da5703752772f49d56142ccd50463.tar.xz
wireguard-linux-2455d6a46c2da5703752772f49d56142ccd50463.zip
iommu/amd: Free domain ID after domain_flush_pages
free_io_pgtable_ops() path uses domain ID to flush pages. Hence free domain ID after flushing everything. Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Link: https://lore.kernel.org/r/20220912063248.7909-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd/iommu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index c55f4a129b1e..00d0f23b0c0a 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -2004,12 +2004,12 @@ static void protection_domain_free(struct protection_domain *domain)
if (!domain)
return;
- if (domain->id)
- domain_id_free(domain->id);
-
if (domain->iop.pgtbl_cfg.tlb)
free_io_pgtable_ops(&domain->iop.iop.ops);
+ if (domain->id)
+ domain_id_free(domain->id);
+
kfree(domain);
}