[PATCH] drm/amdgpu: Fix static checker warning

Christian König ckoenig.leichtzumerken at gmail.com
Fri Nov 23 10:36:45 UTC 2018


Am 23.11.18 um 11:32 schrieb Rex Zhu:
> drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c:49 amdgpu_allocate_static_csa()
> error: uninitialized symbol 'ptr'.
>
> the test if (!bo) doesn't work, as the bo is a pointer to a pointer.
> so need to check !*bo
>
> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>

Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
> index fea4555..d3a2536 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c
> @@ -52,7 +52,7 @@ int amdgpu_allocate_static_csa(struct amdgpu_device *adev, struct amdgpu_bo **bo
>   	r = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE,
>   				domain, bo,
>   				NULL, &ptr);
> -	if (!bo)
> +	if (!*bo)
>   		return -ENOMEM;
>   
>   	memset(ptr, 0, size);



More information about the amd-gfx mailing list