Re: [PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up

2017-04-25 Thread Christian König

Am 24.04.2017 um 21:34 schrieb Alex Xie:

Change-Id: Ib69f035eeb213a1aec5025e0a9f4515065706118
Signed-off-by: Alex Xie 


Reviewed-by: Christian König 


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 9 +
  1 file 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 3453052..76be2d2 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,
}
  
  out_cleanup:

+   /* Check error value now. The value can be overwritten when clean up.*/
+   if (r) {
+   DRM_ERROR("Error while benchmarking BO move.\n");
+   }
+
if (sobj) {
r = amdgpu_bo_reserve(sobj, false);
if (likely(r == 0)) {
@@ -133,10 +138,6 @@ static void amdgpu_benchmark_move(struct amdgpu_device 
*adev, unsigned size,
}
amdgpu_bo_unref();
}
-
-   if (r) {
-   DRM_ERROR("Error while benchmarking BO move.\n");
-   }
  }
  
  void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)



___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH 1/2] drm/amdgpu: Real return value can be over-written when clean up

2017-04-24 Thread Alex Xie
Change-Id: Ib69f035eeb213a1aec5025e0a9f4515065706118
Signed-off-by: Alex Xie 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 9 +
 1 file 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 3453052..76be2d2 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,
}
 
 out_cleanup:
+   /* Check error value now. The value can be overwritten when clean up.*/
+   if (r) {
+   DRM_ERROR("Error while benchmarking BO move.\n");
+   }
+
if (sobj) {
r = amdgpu_bo_reserve(sobj, false);
if (likely(r == 0)) {
@@ -133,10 +138,6 @@ static void amdgpu_benchmark_move(struct amdgpu_device 
*adev, unsigned size,
}
amdgpu_bo_unref();
}
-
-   if (r) {
-   DRM_ERROR("Error while benchmarking BO move.\n");
-   }
 }
 
 void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
-- 
1.9.1

___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx