]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:47:56 +0000 (07:47 -0700)
commit 8b408fe4f853dcfa18d133aa4cf1d7546b4c3870 upstream.

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.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/amd_iommu.c

index 0e9ab4af619bec6d66207cb73d7d7e83f4a6bcca..2e775169bdf0b3bdd6f9e47d139358741bae84f6 100644 (file)
@@ -2379,9 +2379,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;
 }