提交 ff12ce2c 编写于 作者: D Dan Carpenter 提交者: Rodrigo Vivi

drm/i915/gt: Potential error pointer dereference in pinned_context()

If the intel_engine_create_pinned_context() function returns an error
pointer, then dereferencing "ce" will Oops.  Use "vm" instead of
"ce->vm".

Fixes: cf586021 ("drm/i915/gt: Pipelined page migration")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NThomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210813113600.GC30697@kili
上级 8c3363c6
...@@ -177,7 +177,7 @@ static struct intel_context *pinned_context(struct intel_gt *gt) ...@@ -177,7 +177,7 @@ static struct intel_context *pinned_context(struct intel_gt *gt)
ce = intel_engine_create_pinned_context(engine, vm, SZ_512K, ce = intel_engine_create_pinned_context(engine, vm, SZ_512K,
I915_GEM_HWS_MIGRATE, I915_GEM_HWS_MIGRATE,
&key, "migrate"); &key, "migrate");
i915_vm_put(ce->vm); i915_vm_put(vm);
return ce; return ce;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册