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>
This commit is contained in:
Dmitry Osipenko 2019-03-07 01:50:08 +03:00 committed by Joerg Roedel
parent 43a0541e31
commit 4f97031ff8
1 changed files with 3 additions and 0 deletions

View File

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