]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
iommu/tegra-smmu: Properly release domain resources
authorDmitry Osipenko <digetx@gmail.com>
Wed, 6 Mar 2019 22:50:08 +0000 (01:50 +0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 11 Apr 2019 12:51:37 +0000 (14:51 +0200)
Release all memory allocations associated with a released domain and emit
warning if domain is in-use at the time of destruction.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/tegra-smmu.c

index 8d30653cd13a77056c05337a1e47dc9634e6b779..27b1249f0773a765e730312cab0bdc8460095b09 100644 (file)
@@ -327,6 +327,9 @@ static void tegra_smmu_domain_free(struct iommu_domain *domain)
 
        /* TODO: free page directory and page tables */
 
+       WARN_ON_ONCE(as->use_count);
+       kfree(as->count);
+       kfree(as->pts);
        kfree(as);
 }