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

From: Andrzej Hajda
Date: Fri Oct 10 2014 - 07:18:57 EST


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@xxxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/