Skip to content

Commit ba2472e

Browse files
Nirmoy DasChristianKoenigAMD
authored andcommitted
drm/amdgpu: return early for non-TTM_PL_TT type BOs
Return early for non-TTM_PL_TT BOs so that we don't pass wrong pointer to amdgpu_gtt_mgr_has_gart_addr() which assumes ttm_resource argument to be TTM_PL_TT type BO's. v3: remove extra braces. v2: merge if-conditions. Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent eed75ce commit ba2472e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,8 @@ static int amdgpu_ttm_backend_bind(struct ttm_device *bdev,
924924
bo_mem->mem_type == AMDGPU_PL_OA)
925925
return -EINVAL;
926926

927-
if (!amdgpu_gtt_mgr_has_gart_addr(bo_mem)) {
927+
if (bo_mem->mem_type != TTM_PL_TT ||
928+
!amdgpu_gtt_mgr_has_gart_addr(bo_mem)) {
928929
gtt->offset = AMDGPU_BO_INVALID_OFFSET;
929930
return 0;
930931
}

0 commit comments

Comments
 (0)