From fdf2c85f26a656df3c9ef2114ff508a4be26bbff Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 6 May 2016 14:55:02 +0200 Subject: [PATCH] drm: Fix error handling in drm_connector_register When debugfs or sysfs registration failed, we failed to clean up the idr registration. Reorder to fix this. Cc: Dave Airlie Signed-off-by: Daniel Vetter Reviewed-by: Chris Wilson Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1462539302-27764-1-git-send-email-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 70f9c682d144..d2a6d958ca76 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1030,8 +1030,6 @@ int drm_connector_register(struct drm_connector *connector) { int ret; - drm_mode_object_register(connector->dev, &connector->base); - ret = drm_sysfs_connector_add(connector); if (ret) return ret; @@ -1042,6 +1040,8 @@ int drm_connector_register(struct drm_connector *connector) return ret; } + drm_mode_object_register(connector->dev, &connector->base); + return 0; } EXPORT_SYMBOL(drm_connector_register); -- 2.20.1