[PATCH] amdgpu: check parameters in amdgpu_query_gpu_info

Christian König deathsimple at vodafone.de
Sun Oct 30 16:23:59 UTC 2016


Am 28.10.2016 um 23:01 schrieb Alex Deucher:
> Make sure they aren't NULL.
>
> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97993
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>

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

> ---
>
> This bug probably needs to be fixed in the OCL driver, but this
> patch fixes the acute problem and may be enough to fix the bug
> overall.  Needs further investigation by the OCL team.
>
> amdgpu/amdgpu_gpu_info.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
> index 0f23297..66c7e0e 100644
> --- a/amdgpu/amdgpu_gpu_info.c
> +++ b/amdgpu/amdgpu_gpu_info.c
> @@ -230,6 +230,8 @@ drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
>   int amdgpu_query_gpu_info(amdgpu_device_handle dev,
>   			struct amdgpu_gpu_info *info)
>   {
> +	if ((dev == NULL) || (info == NULL))
> +		return -EINVAL;
>   	/* Get ASIC info*/
>   	*info = dev->info;
>   




More information about the amd-gfx mailing list