From: Daniel Vetter Date: Wed, 14 Aug 2013 22:02:38 +0000 (+0200) Subject: drm/prime: fix error path in drm_gem_prime_fd_to_handle X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=730c4ff95eb54e5bab39357baddd0aa6da10d4fb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/prime: fix error path in drm_gem_prime_fd_to_handle 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. Signed-off-by: Daniel Vetter Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index f1159624c68e..82cd83e62e7d 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -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);