Use the omap_gem_free_object() function to destroy the GEM object in the
omap_gem_new_handle() error path instead of doing it manually (and
incorrectly).

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/omap_gem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c 
b/drivers/gpu/drm/omapdrm/omap_gem.c
index f24bb71d9946..ca84943dbfbc 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1445,8 +1445,7 @@ int omap_gem_new_handle(struct drm_device *dev, struct 
drm_file *file,

        ret = drm_gem_handle_create(file, obj, handle);
        if (ret) {
-               drm_gem_object_release(obj);
-               kfree(obj); /* TODO isn't there a dtor to call? just copying 
i915 */
+               omap_gem_free_object(obj);
                return ret;
        }

-- 
2.4.10

Reply via email to