diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 836f1af8b833c0b32695d0e8bf5c2f92d4df7bdf..90c3c36173ba12800365818b15e13bbcc505d907 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -519,8 +519,8 @@ static int igt_switch_to_kernel_context(void *arg) mutex_lock(&i915->drm.struct_mutex); ctx = kernel_context(i915); if (IS_ERR(ctx)) { - err = PTR_ERR(ctx); - goto out_unlock; + mutex_unlock(&i915->drm.struct_mutex); + return PTR_ERR(ctx); } /* First check idling each individual engine */