diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2021-01-18 22:01:13 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2021-01-19 10:22:35 +0100 |
commit | e582951baabba3e278c97169d0acc1e09b24a72e (patch) | |
tree | b445d6b8f2d912373c9da1a6359e2cb40f44fecf /drivers/gpu/drm/scheduler | |
parent | drm: Unamp the entire device address space on device unplug (diff) | |
download | linux-e582951baabba3e278c97169d0acc1e09b24a72e.tar.xz linux-e582951baabba3e278c97169d0acc1e09b24a72e.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/scheduler')
-rw-r--r-- | drivers/gpu/drm/scheduler/sched_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 997aa15dd8d9..92637b70c9bf 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -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); |