Skip to content

Commit 26c95e8

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: set the VM pointer to NULL in amdgpu_job_prepare
As soon as the prepare phase is completed the VM might be released, better set it to NULL. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 57f812d commit 26c95e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,13 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,
361361
dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
362362
goto error;
363363
}
364+
/*
365+
* The VM structure might be released after the VMID is
366+
* assigned, we had multiple problems with people trying to use
367+
* the VM pointer so better set it to NULL.
368+
*/
369+
if (!fence)
370+
job->vm = NULL;
364371
}
365372

366373
return fence;

0 commit comments

Comments
 (0)