diff options
author | Christian König <christian.koenig@amd.com> | 2019-09-23 11:47:22 +0300 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2019-10-14 13:48:59 +0300 |
commit | 73a88e4ce31055c415f1ddb55e3f08c9393cf4e3 (patch) | |
tree | 3c6f451d33933048571f43f0a0ac11c3a3dbb8b5 /drivers/gpu/drm/ttm | |
parent | 78e31c42261779a01bc73472d0f65f15378e9de3 (diff) | |
download | linux-73a88e4ce31055c415f1ddb55e3f08c9393cf4e3.tar.xz |
drm/ttm: fix busy reference in ttm_mem_evict_first
The busy BO might actually be already deleted,
so grab only a list reference.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Hellström <thellstrom@vmware.com>
Link: https://patchwork.freedesktop.org/patch/332877/
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 20ff56f27aa4..ea59459c4128 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -878,11 +878,11 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev, if (!bo) { if (busy_bo) - ttm_bo_get(busy_bo); + kref_get(&busy_bo->list_kref); spin_unlock(&glob->lru_lock); ret = ttm_mem_evict_wait_busy(busy_bo, ctx, ticket); if (busy_bo) - ttm_bo_put(busy_bo); + kref_put(&busy_bo->list_kref, ttm_bo_release_list); return ret; } |