Re: [PATCH] drm/i915/ttm: Rework object initialization slightly

2021-09-29 Thread Thomas Hellström
On 9/28/21 12:30, Matthew Auld wrote: On 27/09/2021 16:10, Thomas Hellström wrote: We may end up in i915_ttm_bo_destroy() in an error path before the object is fully initialized. In that case it's not correct to call __i915_gem_free_object(), because that function a) Assumes the gem object

Re: [PATCH] drm/i915/ttm: Rework object initialization slightly

2021-09-28 Thread Matthew Auld
On 27/09/2021 16:10, Thomas Hellström wrote: We may end up in i915_ttm_bo_destroy() in an error path before the object is fully initialized. In that case it's not correct to call __i915_gem_free_object(), because that function a) Assumes the gem object refcount is 0, which it isn't. b) frees the

[PATCH] drm/i915/ttm: Rework object initialization slightly

2021-09-27 Thread Thomas Hellström
We may end up in i915_ttm_bo_destroy() in an error path before the object is fully initialized. In that case it's not correct to call __i915_gem_free_object(), because that function a) Assumes the gem object refcount is 0, which it isn't. b) frees the placements which are owned by the caller until