]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gt: Prevent use of engine->wa_ctx after error
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 8 Jan 2021 20:40:20 +0000 (20:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 8 Jan 2021 21:35:53 +0000 (21:35 +0000)
commit71d48538cc84cd19d4269f50e1f51e5ffa578c60
treece68473d0b8ed18d7409f808c3af7a7678ed10fd
parent8dd443cee5ef0b4f88417e6af9e6411f329310cb
drm/i915/gt: Prevent use of engine->wa_ctx after error

On error we unpin and free the wa_ctx.vma, but do not clear any of the
derived flags. During lrc_init, we look at the flags and attempt to
dereference the wa_ctx.vma if they are set. To protect the error path
where we try to limp along without the wa_ctx, make sure we clear those
flags!

Reported-by: Matt Roper <matthew.d.roper@intel.com>
Fixes: a8e18f33334e ("drm/i915/lrc: Only enable per-context and per-bb buffers if set")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.15+
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210108204026.20682-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_lrc.c