diff mbox series

drm/i915/ttm: Fix error code in i915_ttm_eviction_valuable()

Message ID 20211122061438.GA2492@kili (mailing list archive)
State New, archived
Headers show
Series drm/i915/ttm: Fix error code in i915_ttm_eviction_valuable() | expand

Commit Message

Dan Carpenter Nov. 22, 2021, 7:41 a.m. UTC
This function returns a bool type so returning -EBUSY is equivalent to
returning true.  It should return false instead.

Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Auld Nov. 22, 2021, 8:52 a.m. UTC | #1
On 22/11/2021 07:41, Dan Carpenter wrote:
> This function returns a bool type so returning -EBUSY is equivalent to
> returning true.  It should return false instead.
> 
> Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index 68cfe6e9ceab..02918b990b25 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -332,7 +332,7 @@  static bool i915_ttm_eviction_valuable(struct ttm_buffer_object *bo,
 	 * but we would like to avoid grabbing locks for no good reason.
 	 */
 	if (bo->ttm && bo->ttm->page_flags & TTM_TT_FLAG_EXTERNAL)
-		return -EBUSY;
+		return false;
 
 	/* Will do for now. Our pinned objects are still on TTM's LRU lists */
 	return i915_gem_object_evictable(obj);