Skip to content

Commit e2f784f

Browse files
amingriyuealexdeucher
authored andcommitted
drm/amdgpu: add err check for pin userptr
Missing error check if the operation failed. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
1 parent 0c62c65 commit e2f784f

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,13 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm,
587587
uint32_t flags = amdgpu_ttm_tt_pte_flags(gtt->adev, ttm, bo_mem);
588588
int r;
589589

590-
if (gtt->userptr)
591-
amdgpu_ttm_tt_pin_userptr(ttm);
592-
590+
if (gtt->userptr) {
591+
r = amdgpu_ttm_tt_pin_userptr(ttm);
592+
if (r) {
593+
DRM_ERROR("failed to pin userptr\n");
594+
return r;
595+
}
596+
}
593597
gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT);
594598
if (!ttm->num_pages) {
595599
WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n",

0 commit comments

Comments
 (0)