Skip to content

Commit

Permalink
drm/amdgpu: If amdgpu_ib_schedule fails return back the error.
Browse files Browse the repository at this point in the history
Use ERR_PTR to return back the error happened during amdgpu_ib_schedule.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Andrey Grodzovsky authored and Alex Deucher committed Oct 30, 2019
1 parent 167bf96 commit 57c0f58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job)
struct amdgpu_ring *ring = to_amdgpu_ring(sched_job->sched);
struct dma_fence *fence = NULL, *finished;
struct amdgpu_job *job;
int r;
int r = 0;

job = to_amdgpu_job(sched_job);
finished = &job->base.s_fence->finished;
Expand All @@ -243,6 +243,8 @@ static struct dma_fence *amdgpu_job_run(struct drm_sched_job *sched_job)
job->fence = dma_fence_get(fence);

amdgpu_job_free_resources(job);

fence = r ? ERR_PTR(r) : fence;
return fence;
}

Expand Down

0 comments on commit 57c0f58

Please sign in to comment.