diff options
author | Christian König <christian.koenig@amd.com> | 2018-07-17 09:02:39 +0200 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2018-07-17 10:05:12 +0200 |
commit | a73d890c6ac434579a9a03e2d4382f5f8e5d204c (patch) | |
tree | df2d2b176a780e279ca97f9566c10b0059c90b99 | |
parent | e09675b81d59d0af2761a8419389946b8f915f56 (diff) |
drm/amdgpu: always initialize job->base.sched
Otherwise we can't clean up the job if we run into an error before it is
pushed to the scheduler.
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index 024efb7ea6d6..42a4764d728e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -54,6 +54,11 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, if (!*job) return -ENOMEM; + /* + * Initialize the scheduler to at least some ring so that we always + * have a pointer to adev. + */ + (*job)->base.sched = &adev->rings[0]->sched; (*job)->vm = vm; (*job)->ibs = (void *)&(*job)[1]; (*job)->num_ibs = num_ibs; |