mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
drm/i915/selftests: avoid using uninitialized context
[ Upstream commit 53139b3f9998ea07289e7b70b909fea2264a0de9 ]
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: 480ae79537 ("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
(cherry picked from commit 8d8334632ea62424233ac6529712868241d0f8df)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
99354bc51c
commit
fae3c2825d
@@ -164,7 +164,7 @@ static int igt_ppgtt_alloc(void *arg)
|
||||
return PTR_ERR(ppgtt);
|
||||
|
||||
if (!ppgtt->vm.allocate_va_range)
|
||||
goto err_ppgtt_cleanup;
|
||||
goto ppgtt_vm_put;
|
||||
|
||||
/*
|
||||
* While we only allocate the page tables here and so we could
|
||||
@@ -232,7 +232,7 @@ err_ppgtt_cleanup:
|
||||
goto retry;
|
||||
}
|
||||
i915_gem_ww_ctx_fini(&ww);
|
||||
|
||||
ppgtt_vm_put:
|
||||
i915_vm_put(&ppgtt->vm);
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user