summaryrefslogtreecommitdiff
path: root/drivers/iommu/tegra-smmu.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2019-03-07 01:50:08 +0300
committerJoerg Roedel <jroedel@suse.de>2019-04-11 15:51:37 +0300
commit4f97031ff8605c1e8388a650bc5708ceda4357d5 (patch)
tree32042b20d3fa9ec809b04762ede5cc36420a43a8 /drivers/iommu/tegra-smmu.c
parent43a0541e312f7136e081e6bf58f6c8a2e9672688 (diff)
downloadlinux-4f97031ff8605c1e8388a650bc5708ceda4357d5.tar.xz
iommu/tegra-smmu: Properly release domain resources
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>
Diffstat (limited to 'drivers/iommu/tegra-smmu.c')
-rw-r--r--drivers/iommu/tegra-smmu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 8d30653cd13a..27b1249f0773 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -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);
}