Commit 1769152ac64b ("drm/amdgpu: Fail fb creation from imported
dma-bufs. (v2)") added a new error path after the buffer is looked up.
This needs to release the reference.

Fixes: 1769152ac64b ("drm/amdgpu: Fail fb creation from imported dma-bufs...")
Signed-off-by: Ben Hutchings <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 38d47559f098..edff85f7fab4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -538,6 +538,7 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,
        /* Handle is imported dma-buf, so cannot be migrated to VRAM for 
scanout */
        if (obj->import_attach) {
                DRM_DEBUG_KMS("Cannot create framebuffer from imported 
dma_buf\n");
+               drm_gem_object_put_unlocked(obj);
                return ERR_PTR(-EINVAL);
        }
 
-- 
2.16.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to