[PATCH] drm/core: make ida allocation and de-allocation consistent

Andrzej Hajda a.hajda at samsung.com
Fri Oct 10 04:16:51 PDT 2014


Connector type id is allocated using ida_simple_get, its counterpart
is ida_simple_remove, so we should use it instead of ida_remove.

Signed-off-by: Andrzej Hajda <a.hajda at samsung.com>
---
 drivers/gpu/drm/drm_crtc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index ecd4e0b..6bf9fdb 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -904,6 +904,8 @@ void drm_connector_cleanup(struct drm_connector *connector)
 {
 	struct drm_device *dev = connector->dev;
 	struct drm_display_mode *mode, *t;
+	struct ida *connector_ida =
+		&drm_connector_enum_list[connector->connector_type].ida;
 
 	list_for_each_entry_safe(mode, t, &connector->probed_modes, head)
 		drm_mode_remove(connector, mode);
@@ -911,8 +913,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 	list_for_each_entry_safe(mode, t, &connector->modes, head)
 		drm_mode_remove(connector, mode);
 
-	ida_remove(&drm_connector_enum_list[connector->connector_type].ida,
-		   connector->connector_type_id);
+	ida_simple_remove(connector_ida, connector->connector_type_id);
 
 	drm_mode_object_put(dev, &connector->base);
 	kfree(connector->name);
-- 
1.9.1



More information about the dri-devel mailing list