Commit c865204e authored by Thomas Hellström's avatar Thomas Hellström Committed by Matthew Auld

drm/i915/ttm: Fix memory leaks

Fix two memory leaks introduced with the ttm backend.

Fixes: 213d5092 ("drm/i915/ttm: Introduce a TTM i915 gem object backend")
Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210615122408.32347-1-thomas.hellstrom@linux.intel.com
parent 8c209f42
...@@ -119,6 +119,7 @@ static void i915_ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *ttm) ...@@ -119,6 +119,7 @@ static void i915_ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *ttm)
struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm); struct i915_ttm_tt *i915_tt = container_of(ttm, typeof(*i915_tt), ttm);
ttm_tt_destroy_common(bdev, ttm); ttm_tt_destroy_common(bdev, ttm);
ttm_tt_fini(ttm);
kfree(i915_tt); kfree(i915_tt);
} }
...@@ -214,6 +215,7 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo) ...@@ -214,6 +215,7 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo)
if (likely(obj)) { if (likely(obj)) {
/* This releases all gem object bindings to the backend. */ /* This releases all gem object bindings to the backend. */
i915_ttm_free_cached_io_st(obj);
__i915_gem_free_object(obj); __i915_gem_free_object(obj);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment