mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
drm/i915/gem: Avoid accessing uninitialized context in emit_rpcs_query()
Following the error path in that function may lead to usage of uninitialized struct i915_gem_ww_ctx object, so move call to i915_gem_ww_ctx_init() a bit earlier. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com> Reviewed-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://lore.kernel.org/r/casutxyfjv7o4ivadvbich2sq2dt22btc5wcke55r56ptgxx2h@lv7hnxrqw5rq
This commit is contained in:
parent
ba391a102e
commit
f4d4097a03
|
|
@ -962,13 +962,14 @@ emit_rpcs_query(struct drm_i915_gem_object *obj,
|
|||
if (IS_ERR(rpcs))
|
||||
return PTR_ERR(rpcs);
|
||||
|
||||
i915_gem_ww_ctx_init(&ww, false);
|
||||
|
||||
batch = i915_vma_instance(rpcs, ce->vm, NULL);
|
||||
if (IS_ERR(batch)) {
|
||||
err = PTR_ERR(batch);
|
||||
goto err_put;
|
||||
}
|
||||
|
||||
i915_gem_ww_ctx_init(&ww, false);
|
||||
retry:
|
||||
err = i915_gem_object_lock(obj, &ww);
|
||||
if (!err)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user