From: Janusz Krzysztofik Date: Fri, 7 May 2021 14:42:51 +0000 (+0200) Subject: drm/i915/gt: Do release kernel context if breadcrumb measure fails X-Git-Tag: accepted/tizen/unified/20230118.172025~6864^2~20^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e49a8b2cc8522a836ec2ade3d8e4dc02de6f4d67;p=platform%2Fkernel%2Flinux-rpi.git drm/i915/gt: Do release kernel context if breadcrumb measure fails Commit fb5970da1b42 ("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 b436a5f8b6c8 ("drm/i915/gt: Track all timelines created using the HWSP"). Signed-off-by: Janusz Krzysztofik Cc: Chris Wilson Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20210507144251.376538-1-janusz.krzysztofik@linux.intel.com --- diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c index 6dbdbde..eba2da9 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c @@ -898,7 +898,7 @@ static int engine_init_common(struct intel_engine_cs *engine) return 0; err_context: - intel_context_put(ce); + destroy_pinned_context(ce); return ret; }