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

Andrey Grodzovsky andrey.grodzovsky at amd.com
Tue Oct 29 15:04:44 UTC 2019


Fix a static code checker warning.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky 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);
 		}
 
-- 
2.7.4



More information about the amd-gfx mailing list