From: Felix Kuehling Date: Thu, 18 Jan 2018 04:54:07 +0000 (-0500) Subject: drm/ttm: Don't unreserve swapped BOs that were previously reserved X-Git-Tag: v4.16-rc1~31^2~7^2~6 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ad76c65ec39f20139885ecd4e5830f2c2a643dcb;p=uclinux-h8%2Flinux.git drm/ttm: Don't unreserve swapped BOs that were previously reserved If ttm_bo_swapout doesn't own the lock, don't release it. Someone else probably depends on it still being locked. Signed-off-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 62518b669ca1..893003fc76a1 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1780,8 +1780,8 @@ out: * Unreserve without putting on LRU to avoid swapping out an * already swapped buffer. */ - - reservation_object_unlock(bo->resv); + if (locked) + reservation_object_unlock(bo->resv); kref_put(&bo->list_kref, ttm_bo_release_list); return ret; }