diff options
author | Chunming Zhou <David1.Zhou@amd.com> | 2015-11-26 08:33:58 (GMT) |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-12-04 16:26:51 (GMT) |
commit | ba98f9e56c77f2b7a28f9d025f8780098221e1b6 (patch) | |
tree | 1d2db1530e1de9403119f8f82c864b3dbd63e3b6 /drivers | |
parent | 0d07db7e10f415d7ec0efde54f10a0905a0910b9 (diff) | |
download | linux-ba98f9e56c77f2b7a28f9d025f8780098221e1b6.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index d4bac5f..8051cb9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -587,9 +587,13 @@ static int amdgpu_ttm_backend_bind(struct ttm_tt *ttm, uint32_t flags = amdgpu_ttm_tt_pte_flags(gtt->adev, ttm, bo_mem); int r; - if (gtt->userptr) - amdgpu_ttm_tt_pin_userptr(ttm); - + if (gtt->userptr) { + r = amdgpu_ttm_tt_pin_userptr(ttm); + if (r) { + DRM_ERROR("failed to pin userptr\n"); + return r; + } + } gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT); if (!ttm->num_pages) { WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n", |