diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 62518b669ca1003b891d33e9be3e0dd65ff565f8..893003fc76a14d430f1367f4ef4458b21fcdca3e 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1780,8 +1780,8 @@ int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx) * 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; }