Am 15.02.2018 um 06:20 schrieb Gustavo A. R. Silva:
Currently, if amdgpu_vm_bo_update() fails, the returned error
is being ignored.
Fix this by properly checking _r_ after calling amdgpu_vm_bo_update.
Also, remove redundant code just before label _error_.
Addresses-Coverity-ID: 1464280 ("Unused value")
Fixes: 0abc6878fc2d ("drm/amdgpu: update VM PDs after the PTs")
Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
Reviewed-by: Christian KÃnig <christian.koenig@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index e48b4ec..db85fc0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -523,12 +523,13 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
ÂÂÂÂÂÂÂÂÂ goto error;
ÂÂÂÂÂ if (operation == AMDGPU_VA_OP_MAP ||
-ÂÂÂÂÂÂÂ operation == AMDGPU_VA_OP_REPLACE)
+ÂÂÂÂÂÂÂ operation == AMDGPU_VA_OP_REPLACE) {
ÂÂÂÂÂÂÂÂÂ r = amdgpu_vm_bo_update(adev, bo_va, false);
+ÂÂÂÂÂÂÂ if (r)
+ÂÂÂÂÂÂÂÂÂÂÂ goto error;
+ÂÂÂ }
ÂÂÂÂÂ r = amdgpu_vm_update_directories(adev, vm);
-ÂÂÂ if (r)
-ÂÂÂÂÂÂÂ goto error;
 error:
ÂÂÂÂÂ if (r && r != -ERESTARTSYS)