Manually checking why a function could fail is not a good idea
if you can just check the functions return code.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) {
struct dma_fence *fence;
- if (adev->mman.buffer_funcs_ring == NULL ||
- !adev->mman.buffer_funcs_ring->ready) {
- r = -EBUSY;
- goto fail_free;
- }
-
r = amdgpu_bo_reserve(bo, false);
if (unlikely(r != 0))
goto fail_free;
if (unlikely(r != 0))
goto fail_unreserve;
- amdgpu_fill_buffer(bo, 0, bo->tbo.resv, &fence);
+ r = amdgpu_fill_buffer(bo, 0, bo->tbo.resv, &fence);
+ if (unlikely(r))
+ goto fail_unreserve;
+
amdgpu_bo_fence(bo, fence, false);
amdgpu_bo_unreserve(bo);
dma_fence_put(bo->tbo.moving);