From: Nicolai Hähnle <[email protected]>

This reverts commit 38fc4856ad98f230bc91da0421dec69e4aee40f8, which
introduces a use-after-free.

The underlying bug should be properly fixed with "drm/ttm: never add BO
that failed to validate to the LRU list".

Cc: Samuel Pitoiset <[email protected]>
Cc: zhoucm1 <[email protected]>
Signed-off-by: Nicolai Hähnle <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 556236a..d1ef1d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -403,11 +403,8 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
                        &bo->placement, page_align, !kernel, NULL,
                        acc_size, sg, resv ? resv : &bo->tbo.ttm_resv,
                        &amdgpu_ttm_bo_destroy);
-       if (unlikely(r != 0)) {
-               if (!resv)
-                       ww_mutex_unlock(&bo->tbo.resv->lock);
+       if (unlikely(r != 0))
                return r;
-       }
 
        bo->tbo.priority = ilog2(bo->tbo.num_pages);
        if (kernel)
-- 
2.9.3

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

Reply via email to