Commit 5f43ac8d authored by Thierry Reding's avatar Thierry Reding

drm/tegra: Fix order of teardown in IOMMU case

The original code works fine, this is merely a cosmetic change to make
the teardown order the reverse of the setup order.
Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 27db6a00
...@@ -204,10 +204,10 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags) ...@@ -204,10 +204,10 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
if (tegra->domain) { if (tegra->domain) {
iommu_domain_free(tegra->domain);
drm_mm_takedown(&tegra->mm);
mutex_destroy(&tegra->mm_lock); mutex_destroy(&tegra->mm_lock);
drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain); put_iova_domain(&tegra->carveout.domain);
iommu_domain_free(tegra->domain);
} }
free: free:
kfree(tegra); kfree(tegra);
...@@ -230,10 +230,10 @@ static void tegra_drm_unload(struct drm_device *drm) ...@@ -230,10 +230,10 @@ static void tegra_drm_unload(struct drm_device *drm)
return; return;
if (tegra->domain) { if (tegra->domain) {
iommu_domain_free(tegra->domain);
drm_mm_takedown(&tegra->mm);
mutex_destroy(&tegra->mm_lock); mutex_destroy(&tegra->mm_lock);
drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain); put_iova_domain(&tegra->carveout.domain);
iommu_domain_free(tegra->domain);
} }
kfree(tegra); kfree(tegra);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment