[PATCH] drm/i915/selftests: avoid using uninitialized context
Krzysztof Karas
krzysztof.karas at intel.com
Tue Jan 28 12:11:48 UTC 2025
Hi Sebastian,
thanks for review.
> I don't thing it's a best idea to just initialize ww here, you still have
> incorrect path that try to fini ww before it was initialize.
Fair point - we still call i915_gem_ww_ctx_fini(), which is
useless without actual ww.
>
> I would probably do something like this instead.
> ------------------------------------
> diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> index 5816d515203a..526518bc4dba 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
> @@ -167,8 +167,10 @@ static int igt_ppgtt_alloc(void *arg)
> if (IS_ERR(ppgtt))
> return PTR_ERR(ppgtt);
>
> - if (!ppgtt->vm.allocate_va_range)
> - goto err_ppgtt_cleanup;
> + if (!ppgtt->vm.allocate_va_range) {
> + i915_vm_put(&ppgtt->vm);
> + return 0;
> + }
> ------------------------------------
Ok, I'll put that into a v2 soon.
Krzysztof
More information about the dri-devel
mailing list