Skip to content

Commit 8d83346

Browse files
KKaras169169Andi Shyti
authored andcommitted
drm/i915/selftests: avoid using uninitialized context
There is an error path in igt_ppgtt_alloc(), which leads to ww object being passed down to i915_gem_ww_ctx_fini() without initialization. Correct that by only putting ppgtt->vm and returning early. Fixes: 480ae79 ("drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal") Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com> Reviewed-by: Mikolaj Wasiak <mikolaj.wasiak@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/iuaonpjc3rywmvhna6umjlvzilocn2uqsrxfxfob24e2taocbi@lkaivvfp4777
1 parent 87b593d commit 8d83346

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int igt_ppgtt_alloc(void *arg)
168168
return PTR_ERR(ppgtt);
169169

170170
if (!ppgtt->vm.allocate_va_range)
171-
goto err_ppgtt_cleanup;
171+
goto ppgtt_vm_put;
172172

173173
/*
174174
* While we only allocate the page tables here and so we could
@@ -236,7 +236,7 @@ static int igt_ppgtt_alloc(void *arg)
236236
goto retry;
237237
}
238238
i915_gem_ww_ctx_fini(&ww);
239-
239+
ppgtt_vm_put:
240240
i915_vm_put(&ppgtt->vm);
241241
return err;
242242
}

0 commit comments

Comments
 (0)