drm/omapdrm: avoid double drm_mode_config_cleanup()
Subsystems (3)
PATCH 1/1 drm/omapdrm: avoid double drm_mode_config_cleanup()
omapdrm_init() unwinds drm_vblank_init() and drm_dev_register() failures through omap_modeset_fini() and then falls through to err_gem_deinit, which calls drm_mode_config_cleanup() again.
omapdrm_cleanup() has the same problem during the normal teardown path:
it calls omap_modeset_fini() and then calls drm_mode_config_cleanup() again afterwards.
omap_modeset_fini() should only undo omap_modeset_init(). The drm_mode_config_init()/drm_mode_config_cleanup() pairing already lives in the top-level init and cleanup paths, so keeping another drm_mode_config_cleanup() inside omap_modeset_fini() causes repeated cleanup of the same mode_config state.
Remove drm_mode_config_cleanup() from omap_modeset_fini() so each path cleans mode_config exactly once.
Issue found using a prototype static analysis tool and confirmed by code review.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +0 -2
@@ -538,8 +538,6 @@ static int omap_modeset_init(struct drm_device *dev)static void omap_modeset_fini (struct drm_device *ddev) {omap_drm_irq_uninstall (ddev); - -drm_mode_config_cleanup (ddev); }/*
Signature · 1 line
2.50.1.windows.1