drm/amd/sched: NULL out the s_fence field after run_job
amd_sched_process_job drops the fence reference, so NULL out the s_fence field before adding it as a callback to guard against accidentally using s_fence after it may have be freed. v2: add a clarifying comment Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Andres Rodriguez <andresx7@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
214a91e6bf
commit
29d2535535
|
@ -611,6 +611,10 @@ static int amd_sched_main(void *param)
|
|||
|
||||
fence = sched->ops->run_job(sched_job);
|
||||
amd_sched_fence_scheduled(s_fence);
|
||||
|
||||
/* amd_sched_process_job drops the job's reference of the fence. */
|
||||
sched_job->s_fence = NULL;
|
||||
|
||||
if (fence) {
|
||||
s_fence->parent = dma_fence_get(fence);
|
||||
r = dma_fence_add_callback(fence, &s_fence->cb,
|
||||
|
|
Loading…
Reference in New Issue