diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2019-10-24 15:44:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-12 19:21:14 +0100 |
commit | e5edbf9c45cec143526d9d1708d216228a197cd8 (patch) | |
tree | a6efcddd6db4e03c91b8c141b02baf149cb4fc10 /drivers/gpu | |
parent | b651ddc15e7adfe6ce969a5dc2787281ac12214a (diff) | |
download | linux-stable-e5edbf9c45cec143526d9d1708d216228a197cd8.tar.gz linux-stable-e5edbf9c45cec143526d9d1708d216228a197cd8.tar.bz2 linux-stable-e5edbf9c45cec143526d9d1708d216228a197cd8.zip |
drm/amdgpu: If amdgpu_ib_schedule fails return back the error.
[ Upstream commit 57c0f58e9f562089de5f0b60da103677d232374c ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index f823d4baf044..cf582cc46d53 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -203,7 +203,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; @@ -228,6 +228,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; } |