drm/amdgpu_gem: fix error handling path in amdgpu_gem_va_update_vm
Subsystems (2)
PATCH 1/1 drm/amdgpu_gem: fix error handling path in amdgpu_gem_va_update_vm
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")
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +4 -3
@@ -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 )
Signature · 1 line
2.7.4
Am 15.02.2018 um 06:20 schrieb Gustavo A. R. Silva:
Quoted 9 lines
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 <[email protected]>
Quoted 15 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1
-1@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev, · line 535
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +3
-2+if (r) + goto error; + } r =amdgpu_vm_update_directories (adev, vm); -if (r) - goto error; error:if (r && r != -ERESTARTSYS )
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Christian König
Am 15.02.2018 um 06:20 schrieb Gustavo A. R. Silva:
Quoted 3 lines
Currently, if
amdgpu_vm_bo_update()fails, the returned error is being ignored.
Quoted 9 lines
Quoted 6 lines
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 <[email protected]>Reviewed-by Christian König <[email protected]>
Thanks, Christian
--
Gustavo
Quoted 24 lines
Quoted 23 lines
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 7 ++++---1 file changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0
-0@@ -523,12 +523,13 @@ static void amdgpu_gem_va_update_vm(structamdgpu_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)