[PATCH] drm/sched: Fix passing zero to 'PTR_ERR' warning

Christian König ckoenig.leichtzumerken at gmail.com
Tue Oct 29 13:06:06 UTC 2019


Am 29.10.19 um 16:04 schrieb Andrey Grodzovsky:
> Fix a static code checker warning.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>

Well that one was even new to me.

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

> ---
>   drivers/gpu/drm/scheduler/sched_main.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index f39b97e..898b0c9 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -497,7 +497,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
>   
>   		if (IS_ERR_OR_NULL(fence)) {
>   			s_job->s_fence->parent = NULL;
> -			dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
> +			dma_fence_set_error(&s_fence->finished, PTR_ERR_OR_ZERO(fence));
>   		} else {
>   			s_job->s_fence->parent = fence;
>   		}
> @@ -742,7 +742,7 @@ static int drm_sched_main(void *param)
>   			dma_fence_put(fence);
>   		} else {
>   
> -			dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
> +			dma_fence_set_error(&s_fence->finished, PTR_ERR_OR_ZERO(fence));
>   			drm_sched_process_job(NULL, &sched_job->cb);
>   		}
>   



More information about the amd-gfx mailing list