]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/selftests: Avoid ERR_PTR dereference
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 20 Jun 2018 11:24:41 +0000 (12:24 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 20 Jun 2018 12:12:22 +0000 (13:12 +0100)
commit7e74b2dffaec092920b89c5930579376eaf6b702
treee8f9942b143b73a8bb3d48eeed3cc080d6ada251
parent4285b1854b93cd3d8254eb6de89360988ddf3ad3
drm/i915/selftests: Avoid ERR_PTR dereference

Along the early error path for igt_switch_to_kernel_context we may try
to dereference an invalid error pointer. Instead, return early rather
than dump the GEM trace since we haven't yet emitted anything of
interest.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 06b81dac2abf ("drm/i915: Look for an active kernel context before switching")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180620112441.13085-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/i915_gem_context.c