Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d159f26c authored by Alex Xie's avatar Alex Xie Committed by Alex Deucher
Browse files

drm/amdgpu: Real return value can be over-written when clean up

parent f3aa745e
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -117,6 +117,11 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
	}
	}


out_cleanup:
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) {
	if (sobj) {
		r = amdgpu_bo_reserve(sobj, false);
		r = amdgpu_bo_reserve(sobj, false);
		if (likely(r == 0)) {
		if (likely(r == 0)) {
@@ -133,10 +138,6 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size,
		}
		}
		amdgpu_bo_unref(&dobj);
		amdgpu_bo_unref(&dobj);
	}
	}

	if (r) {
		DRM_ERROR("Error while benchmarking BO move.\n");
	}
}
}


void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)
void amdgpu_benchmark(struct amdgpu_device *adev, int test_number)