Skip to content

Commit 6cc3074

Browse files
pixelclusteralexdeucher
authored andcommitted
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: 0cce5f2 ("drm/amdkfd: Check correct memory types for is_system variable") Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Natalie Vock <natalie.vock@gmx.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 3e3fcd2) Cc: stable@vger.kernel.org # 6.12.x
1 parent 0882ca4 commit 6cc3074

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,9 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
528528

529529
bo_adev = amdgpu_ttm_adev(bo->tbo.bdev);
530530
coherent = bo->flags & AMDGPU_GEM_CREATE_COHERENT;
531-
is_system = (bo->tbo.resource->mem_type == TTM_PL_TT) ||
532-
(bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
531+
is_system = bo->tbo.resource &&
532+
(bo->tbo.resource->mem_type == TTM_PL_TT ||
533+
bo->tbo.resource->mem_type == AMDGPU_PL_PREEMPT);
533534

534535
if (bo && bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC)
535536
*flags |= AMDGPU_PTE_DCC;

0 commit comments

Comments
 (0)