Message ID | 20180620110907.pnr5zrqmsko4cyvy@kili.mountain (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 836f1af8b833..e41036fcd97e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -541,7 +541,8 @@ static int igt_switch_to_kernel_context(void *arg) err = -EIO; mutex_unlock(&i915->drm.struct_mutex); - kernel_context_close(ctx); + if (!IS_ERR(ctx)) + kernel_context_close(ctx); return err; }
There is an error path where "ctx" is an error pointer so we can't pass it to kernel_context_close(). Fixes: 09a4c02e58c1 ("drm/i915: Look for an active kernel context before switching") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>