mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
drm/scheduler: add NULL pointer check for run queue (v2)
To check rq pointer before adding entity into it. That avoids NULL pointer access in some case. v2: move the check to caller Suggested-by: Christian König <christian.koenig@amd.com> Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
964d0fbf63
commit
a6da48caf9
1 changed files with 5 additions and 0 deletions
|
@ -547,6 +547,11 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job,
|
|||
if (first) {
|
||||
/* Add the entity to the run queue */
|
||||
spin_lock(&entity->rq_lock);
|
||||
if (!entity->rq) {
|
||||
DRM_ERROR("Trying to push to a killed entity\n");
|
||||
spin_unlock(&entity->rq_lock);
|
||||
return;
|
||||
}
|
||||
drm_sched_rq_add_entity(entity->rq, entity);
|
||||
spin_unlock(&entity->rq_lock);
|
||||
drm_sched_wakeup(sched);
|
||||
|
|
Loading…
Reference in a new issue