[PATCH] drm/amdkfd: Fix unchecked return value

Kuehling, Felix Felix.Kuehling at amd.com
Mon Mar 18 18:25:32 UTC 2019


Alex already applied an equivalent patch by Colin King (attached for 
reference).

Regards,
   Felix

On 3/18/2019 2:05 PM, Gustavo A. R. Silva wrote:
> Assign return value of function amdgpu_bo_sync_wait() to variable ret
> for its further check.
>
> Addresses-Coverity-ID: 1443914 ("Logically dead code")
> Fixes: c60cd590cb7d ("drm/amdgpu: Replace ttm_bo_wait with amdgpu_bo_sync_wait")
> Signed-off-by: Gustavo A. R. Silva <gustavo at embeddedor.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> index 1921dec3df7a..fb621abcb006 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
> @@ -906,7 +906,8 @@ static int init_kfd_vm(struct amdgpu_vm *vm, void **process_info,
>   		pr_err("validate_pt_pd_bos() failed\n");
>   		goto validate_pd_fail;
>   	}
> -	amdgpu_bo_sync_wait(vm->root.base.bo, AMDGPU_FENCE_OWNER_KFD, false);
> +	ret = amdgpu_bo_sync_wait(vm->root.base.bo, AMDGPU_FENCE_OWNER_KFD,
> +				  false);
>   	if (ret)
>   		goto wait_pd_fail;
>   	amdgpu_bo_fence(vm->root.base.bo,
-------------- next part --------------
An embedded message was scrubbed...
From: Colin King <colin.king at canonical.com>
Subject: [PATCH][drm-next] drm/amdgpu: fix missing assignment of error return code to variable ret
Date: Sat, 2 Mar 2019 22:16:58 +0000
Size: 10506
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20190318/98cdfc50/attachment-0001.mht>


More information about the amd-gfx mailing list