Commit 730c4ff9 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent a8e11d1c
...@@ -476,7 +476,7 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev, ...@@ -476,7 +476,7 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev,
/* hmm, if driver attached, we are relying on the free-object path /* hmm, if driver attached, we are relying on the free-object path
* to detach.. which seems ok.. * to detach.. which seems ok..
*/ */
drm_gem_object_handle_unreference_unlocked(obj); drm_gem_handle_delete(file_priv, *handle);
out_put: out_put:
dma_buf_put(dma_buf); dma_buf_put(dma_buf);
mutex_unlock(&file_priv->prime.lock); mutex_unlock(&file_priv->prime.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment