Skip to content

Commit 2c772cf

Browse files
Dan Carpenterjnikula
authored andcommitted
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: cf58602 ("drm/i915/gt: Pipelined page migration") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/20210813113600.GC30697@kili (cherry picked from commit ff12ce2) Signed-off-by: Jani Nikula <[email protected]>
1 parent 3070d93 commit 2c772cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gt/intel_migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static struct intel_context *pinned_context(struct intel_gt *gt)
177177
ce = intel_engine_create_pinned_context(engine, vm, SZ_512K,
178178
I915_GEM_HWS_MIGRATE,
179179
&key, "migrate");
180-
i915_vm_put(ce->vm);
180+
i915_vm_put(vm);
181181
return ce;
182182
}
183183

0 commit comments

Comments
 (0)