Skip to content

Commit

Permalink
drm/radeon: check return value of radeon_fence_emit
Browse files Browse the repository at this point in the history
Function radeon_fence_emit() returns -ENOMEM if there is no enough
memory. And in this case, function radeon_ring_unlock_undo() rather than
function radeon_ring_unlock_commit() should be called. However, in
function radeon_test_create_and_emit_fence(), the return value of
radeon_fence_emit() is ignored. This patch adds the check.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Pan Bian authored and Alex Deucher committed Apr 28, 2017
1 parent c346fb7 commit 2f2429c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/gpu/drm/radeon/radeon_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,12 @@ static int radeon_test_create_and_emit_fence(struct radeon_device *rdev,
DRM_ERROR("Failed to lock ring A %d\n", ring->idx);
return r;
}
radeon_fence_emit(rdev, fence, ring->idx);
r = radeon_fence_emit(rdev, fence, ring->idx);
if (r) {
DRM_ERROR("Failed to emit fence\n");
radeon_ring_unlock_undo(rdev, ring);
return r;
}
radeon_ring_unlock_commit(rdev, ring, false);
}
return 0;
Expand Down

0 comments on commit 2f2429c

Please sign in to comment.