Skip to contentSkip to conversation

drm: Fix error handling in drm_connector_register

PATCH In review Daniel Vetter 2 participants 2 messages May 6, 2016 – May 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/gpu/drm/drm_crtc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_crtc.c +2 -2
index a93cb4cffb0e..8842909b93d6 100644
@@ -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);
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Daniel Vetter

When debugfs or sysfs registration failed, we failed to clean up the idr registration. Reorder to fix this.

Had to check that we could do the idr_replace after exposing sysfs/debugfs objects and came to the conclusion that those objects do not depend upon the idr, so

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel