We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 973a9c8 commit 74ea8e7Copy full SHA for 74ea8e7
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -161,8 +161,14 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
161
struct dma_fence *f;
162
unsigned i;
163
164
- /* use sched fence if available */
165
- f = job->base.s_fence ? &job->base.s_fence->finished : &job->hw_fence;
+ /* Check if any fences where initialized */
+ if (job->base.s_fence && job->base.s_fence->finished.ops)
166
+ f = &job->base.s_fence->finished;
167
+ else if (job->hw_fence.ops)
168
+ f = &job->hw_fence;
169
+ else
170
+ f = NULL;
171
+
172
for (i = 0; i < job->num_ibs; ++i)
173
amdgpu_ib_free(ring->adev, &job->ibs[i], f);
174
}
0 commit comments