Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: Fix ordering of cleanup code

Commit Fixes: b9f8b09ce256 ("drm/tegra: Setup shared IOMMU domain after
initialization") changed the initialization order of the IOMMU related
bits but didn't update the cleanup path accordingly. This asymmetry can
cause failures during error recovery.

Fixes: b9f8b09ce256 ("drm/tegra: Setup shared IOMMU domain after initialization")
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>

+7 -7
+7 -7
drivers/gpu/drm/tegra/drm.c
··· 201 201 if (tegra->hub) 202 202 tegra_display_hub_cleanup(tegra->hub); 203 203 device: 204 - host1x_device_exit(device); 205 - fbdev: 206 - drm_kms_helper_poll_fini(drm); 207 - tegra_drm_fb_free(drm); 208 - config: 209 - drm_mode_config_cleanup(drm); 210 - 211 204 if (tegra->domain) { 212 205 mutex_destroy(&tegra->mm_lock); 213 206 drm_mm_takedown(&tegra->mm); 214 207 put_iova_domain(&tegra->carveout.domain); 215 208 iova_cache_put(); 216 209 } 210 + 211 + host1x_device_exit(device); 212 + fbdev: 213 + drm_kms_helper_poll_fini(drm); 214 + tegra_drm_fb_free(drm); 215 + config: 216 + drm_mode_config_cleanup(drm); 217 217 domain: 218 218 if (tegra->domain) 219 219 iommu_domain_free(tegra->domain);