Skip to content

Commit

Permalink
drm/tegra: Fix order of teardown in IOMMU case
Browse files Browse the repository at this point in the history
The original code works fine, this is merely a cosmetic change to make
the teardown order the reverse of the setup order.

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
thierryreding committed May 17, 2018
1 parent 27db6a0 commit 5f43ac8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/tegra/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags)
drm_mode_config_cleanup(drm);

if (tegra->domain) {
iommu_domain_free(tegra->domain);
drm_mm_takedown(&tegra->mm);
mutex_destroy(&tegra->mm_lock);
drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain);
iommu_domain_free(tegra->domain);
}
free:
kfree(tegra);
Expand All @@ -230,10 +230,10 @@ static void tegra_drm_unload(struct drm_device *drm)
return;

if (tegra->domain) {
iommu_domain_free(tegra->domain);
drm_mm_takedown(&tegra->mm);
mutex_destroy(&tegra->mm_lock);
drm_mm_takedown(&tegra->mm);
put_iova_domain(&tegra->carveout.domain);
iommu_domain_free(tegra->domain);
}

kfree(tegra);
Expand Down

0 comments on commit 5f43ac8

Please sign in to comment.