Skip to content
Snippets Groups Projects
Commit 6cc30748 authored by Natalie Vock's avatar Natalie Vock Committed by Alex Deucher
Browse files

drm/amdgpu: NULL-check BO's backing store when determining GFX12 PTE flags


PRT BOs may not have any backing store, so bo->tbo.resource will be
NULL. Check for that before dereferencing.

Fixes: 0cce5f28 ("drm/amdkfd: Check correct memory types for is_system variable")
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarNatalie Vock <natalie.vock@gmx.de>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 3e3fcd29)
Cc: stable@vger.kernel.org # 6.12.x
parent 0882ca4e
No related branches found
No related tags found
No related merge requests found
......@@ -528,8 +528,9 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
coherent = bo->flags & AMDGPU_GEM_CREATE_COHERENT;
is_system = (bo->tbo.resource->mem_type == TTM_PL_TT) ||
(bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
is_system = bo->tbo.resource &&
(bo->tbo.resource->mem_type == TTM_PL_TT ||
bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
if (bo && bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC)
*flags |= AMDGPU_PTE_DCC;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment