]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
x86/amd-iommu: Use helper function to destroy domain
authorJoerg Roedel <joerg.roedel@amd.com>
Mon, 8 Mar 2010 13:20:07 +0000 (14:20 +0100)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 8 Mar 2010 13:20:07 +0000 (14:20 +0100)
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>
arch/x86/kernel/amd_iommu.c

index 0c0425436a7323ab320b5b30e0060fa45b94dc67..b06f29e275e91cd6792359f3c8fdca905f7ede91 100644 (file)
@@ -2380,9 +2380,7 @@ static void amd_iommu_domain_destroy(struct iommu_domain *dom)
 
        free_pagetable(domain);
 
-       domain_id_free(domain->id);
-
-       kfree(domain);
+       protection_domain_free(domain);
 
        dom->priv = NULL;
 }