drm/sched: Cancel and flush all outstanding jobs before finish.

To avoid any possible use after free.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/414814/
CC: stable@vger.kernel.org
Signed-off-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Andrey Grodzovsky 2021-01-18 16:01:13 -05:00 committed by Christian König
parent b9d4efa8f9
commit e582951baa
1 changed files with 3 additions and 0 deletions

View File

@ -899,6 +899,9 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched)
if (sched->thread)
kthread_stop(sched->thread);
/* Confirm no work left behind accessing device structures */
cancel_delayed_work_sync(&sched->work_tdr);
sched->ready = false;
}
EXPORT_SYMBOL(drm_sched_fini);