Skip to content

Commit

Permalink
drm/amdgpu: set the VM pointer to NULL in amdgpu_job_prepare
Browse files Browse the repository at this point in the history
As soon as the prepare phase is completed the VM might be released,
better set it to NULL.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Dec 18, 2024
1 parent 57f812d commit 26c95e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,13 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,
dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);
goto error;
}
/*
* The VM structure might be released after the VMID is
* assigned, we had multiple problems with people trying to use
* the VM pointer so better set it to NULL.
*/
if (!fence)
job->vm = NULL;
}

return fence;
Expand Down

0 comments on commit 26c95e8

Please sign in to comment.