[PATCH 01/26] drm/i915: Fix ttm_bo_init failure handling

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Oct 1 09:58:39 UTC 2021


Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
index a77e90f300fe..97fe4f05fe9d 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
@@ -898,6 +898,9 @@ void i915_ttm_bo_destroy(struct ttm_buffer_object *bo)
 {
 	struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
 
+	/* set base refcount to 0 in case ttm_bo_init failed */
+	refcount_set(&obj->base.refcount.refcount, 0);
+
 	i915_ttm_backup_free(obj);
 
 	/* This releases all gem object bindings to the backend. */
-- 
2.33.0



More information about the Intel-gfx-trybot mailing list