[PATCH] drm/amdgpu: Fix null pointer issue in amdgpu_cs_wait_any_fence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 09.11.2017 um 08:59 schrieb Emily Deng:
> The array[first] may be null when the fence has already been signaled.
>
> BUG: SWDEV-136239
>
> Signed-off-by: Emily Deng <Emily.Deng at amd.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 354c874..182df08 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1502,8 +1502,11 @@ static int amdgpu_cs_wait_any_fence(struct amdgpu_device *adev,
>   	memset(wait, 0, sizeof(*wait));
>   	wait->out.status = (r > 0);
>   	wait->out.first_signaled = first;
> -	/* set return value 0 to indicate success */
> -	r = array[first]->error;
> +
> +	if (array[first])
> +		r = array[first]->error;
> +	else
> +		r = 0;
>   
>   err_free_fence_array:
>   	for (i = 0; i < fence_count; i++)




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux