drm/prime: fix error path in drm_gem_prime_fd_to_handle
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 14 Aug 2013 22:02:38 +0000 (00:02 +0200)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Wed, 13 Jan 2016 01:29:18 +0000 (10:29 +0900)
handle_unreference only clears up the obj->name and the reference,
but would leave a dangling handle in the idr. The right thing
to do is to call handle_delete.

Change-Id: I69134c470800d5be810892d8bae77a5c5bac6dc9
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_prime.c

index f115962..82cd83e 100644 (file)
@@ -476,7 +476,7 @@ fail:
        /* hmm, if driver attached, we are relying on the free-object path
         * to detach.. which seems ok..
         */
-       drm_gem_object_handle_unreference_unlocked(obj);
+       drm_gem_handle_delete(file_priv, *handle);
 out_put:
        dma_buf_put(dma_buf);
        mutex_unlock(&file_priv->prime.lock);