From ab964dc6bbe51dd649f8cbfbe8fbfefdfd6a81c1 Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 20 Jun 2023 02:31:50 +0000 Subject: [PATCH] drm/i915/gt: Use the correct error value when kernel_context() fails From Andi Shyti 8d42c563e4ddbe2d0d71249f137b02daa66972db in linux-6.1.y/6.1.34 40023959dbab3c6ad56fa7213770e63d197b69fb in mainline linux --- sys/dev/pci/drm/i915/gt/selftest_execlists.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/drm/i915/gt/selftest_execlists.c b/sys/dev/pci/drm/i915/gt/selftest_execlists.c index 6312f42daef..b370411d436 100644 --- a/sys/dev/pci/drm/i915/gt/selftest_execlists.c +++ b/sys/dev/pci/drm/i915/gt/selftest_execlists.c @@ -1532,8 +1532,8 @@ static int live_busywait_preempt(void *arg) struct drm_i915_gem_object *obj; struct i915_vma *vma; enum intel_engine_id id; - int err = -ENOMEM; u32 *map; + int err; /* * Verify that even without HAS_LOGICAL_RING_PREEMPTION, we can @@ -1541,13 +1541,17 @@ static int live_busywait_preempt(void *arg) */ ctx_hi = kernel_context(gt->i915, NULL); - if (!ctx_hi) - return -ENOMEM; + if (IS_ERR(ctx_hi)) + return PTR_ERR(ctx_hi); + ctx_hi->sched.priority = I915_CONTEXT_MAX_USER_PRIORITY; ctx_lo = kernel_context(gt->i915, NULL); - if (!ctx_lo) + if (IS_ERR(ctx_lo)) { + err = PTR_ERR(ctx_lo); goto err_ctx_hi; + } + ctx_lo->sched.priority = I915_CONTEXT_MIN_USER_PRIORITY; obj = i915_gem_object_create_internal(gt->i915, PAGE_SIZE); -- 2.20.1