diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-06-21 14:52:46 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-06-21 15:38:54 +0100 |
commit | 5f6730a4689269240e911853403456e243513ae0 (patch) | |
tree | ac1641b866626962711094383a70caf2ba0b8786 /drivers/gpu | |
parent | db56f974941b75b2c96e577100e7abe64b03d9b9 (diff) |
drm/i915: Prevent dereference of engine before NULL check in error capture
smatch caught,
drivers/gpu/drm/i915/i915_gpu_error.c:1418 gem_record_rings() warn: variable dereferenced before check 'engine' (see line 1413)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190621135246.20683-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gpu_error.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 59f5b0265ee3..5489cd879315 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1410,7 +1410,6 @@ static void gem_record_rings(struct i915_gpu_state *error) for (i = 0; i < I915_NUM_ENGINES; i++) { struct intel_engine_cs *engine = i915->engine[i]; struct drm_i915_error_engine *ee = &error->engine[i]; - struct i915_ggtt *ggtt = engine->gt->ggtt; struct i915_request *request; ee->engine_id = -1; @@ -1428,7 +1427,7 @@ static void gem_record_rings(struct i915_gpu_state *error) struct i915_gem_context *ctx = request->gem_context; struct intel_ring *ring; - ee->vm = ctx->vm ?: &ggtt->vm; + ee->vm = ctx->vm ?: &engine->gt->ggtt->vm; record_context(&ee->context, ctx); |