Commit e49a8b2c authored by Janusz Krzysztofik's avatar Janusz Krzysztofik Committed by Tvrtko Ursulin

drm/i915/gt: Do release kernel context if breadcrumb measure fails

Commit fb5970da ("drm/i915/gt: Use the kernel_context to measure the
breadcrumb size") reordered some operations inside engine_init_common()
and added an error unwind path to that function.  In that path, a
reference to a kernel context candidate supposed to be released on error
was put, but the context, pinned when created, was not unpinned first.
Fix it by replacing intel_context_put() with destroy_pinned_context()
introduced later by commit b436a5f8 ("drm/i915/gt: Track all timelines
created using the HWSP").
Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210507144251.376538-1-janusz.krzysztofik@linux.intel.com
parent ae9faeb9
...@@ -898,7 +898,7 @@ static int engine_init_common(struct intel_engine_cs *engine) ...@@ -898,7 +898,7 @@ static int engine_init_common(struct intel_engine_cs *engine)
return 0; return 0;
err_context: err_context:
intel_context_put(ce); destroy_pinned_context(ce);
return ret; return ret;
} }
......
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