]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/sched: Fix passing zero to 'PTR_ERR' warning v2
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Tue, 29 Oct 2019 15:03:05 +0000 (11:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Nov 2019 21:27:47 +0000 (16:27 -0500)
Fix a static code checker warning.

v2: Drop PTR_ERR_OR_ZERO.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Emily Deng <Emily.Deng@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/scheduler/sched_main.c

index 2af64459b3d77023c0554a89e950a57d0b526e6e..fbb6446c4f69ef3970e9d5849c3b5cfc9bfa5700 100644 (file)
@@ -496,8 +496,10 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched)
                fence = sched->ops->run_job(s_job);
 
                if (IS_ERR_OR_NULL(fence)) {
+                       if (IS_ERR(fence))
+                               dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
+
                        s_job->s_fence->parent = NULL;
-                       dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
                } else {
                        s_job->s_fence->parent = fence;
                }
@@ -746,8 +748,9 @@ static int drm_sched_main(void *param)
                                          r);
                        dma_fence_put(fence);
                } else {
+                       if (IS_ERR(fence))
+                               dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
 
-                       dma_fence_set_error(&s_fence->finished, PTR_ERR(fence));
                        drm_sched_process_job(NULL, &sched_job->cb);
                }