aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
diff options
context:
space:
mode:
authorAlex Xie <AlexBin.Xie@amd.com>2017-04-24 15:26:57 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-04-28 17:33:07 -0400
commitd159f26caaa91c88e9078c69fd159be9cec3a005 (patch)
tree58f5d60ff2d31999a1832aaef92d262f39467cc0 /drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
parentf3aa745eedc851742f6d6574ee2322c021b8f33c (diff)
drm/amdgpu: Real return value can be over-written when clean up
Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
index cc97eee93226..726b3e018eeb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c
@@ -117,6 +117,11 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
117 } 117 }
118 118
119out_cleanup: 119out_cleanup:
120 /* Check error value now. The value can be overwritten when clean up.*/
121 if (r) {
122 DRM_ERROR("Error while benchmarking BO move.\n");
123 }
124
120 if (sobj) { 125 if (sobj) {
121 r = amdgpu_bo_reserve(sobj, false); 126 r = amdgpu_bo_reserve(sobj, false);
122 if (likely(r == 0)) { 127 if (likely(r == 0)) {
@@ -133,10 +138,6 @@ out_cleanup:
133 } 138 }
134 amdgpu_bo_unref(&dobj); 139 amdgpu_bo_unref(&dobj);
135 } 140 }
136
137 if (r) {
138 DRM_ERROR("Error while benchmarking BO move.\n");
139 }
140} 141}
141 142
142void amdgpu_benchmark(struct amdgpu_device *adev, int test_number) 143void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)