aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-03-08 08:20:07 -0500
committerJoerg Roedel <joerg.roedel@amd.com>2010-03-08 08:20:07 -0500
commit8b408fe4f853dcfa18d133aa4cf1d7546b4c3870 (patch)
tree1eaa55a03e58f8499ac653c149dd12985129137d /arch/x86
parent3551a708f35fc712af43aeb7f541512c5cfc4936 (diff)
x86/amd-iommu: Use helper function to destroy domain
In the amd_iommu_domain_destroy the protection_domain_free function is partly reimplemented. The 'partly' is the bug here because the domain is not deleted from the domain list. This results in use-after-free errors and data-corruption. Fix it by just using protection_domain_free instead. Cc: stable@kernel.org Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/amd_iommu.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 0c0425436a73..b06f29e275e9 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -2380,9 +2380,7 @@ static void amd_iommu_domain_destroy(struct iommu_domain *dom)
2380 2380
2381 free_pagetable(domain); 2381 free_pagetable(domain);
2382 2382
2383 domain_id_free(domain->id); 2383 protection_domain_free(domain);
2384
2385 kfree(domain);
2386 2384
2387 dom->priv = NULL; 2385 dom->priv = NULL;
2388} 2386}