From: Erico Nunes Date: Mon, 20 May 2019 23:16:49 +0000 (+0200) Subject: drm/scheduler: Fix job cleanup without timeout handler X-Git-Tag: v5.4-rc1~498^2~30^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=794c686eb7830b12e27999fd776f6d021ce22658;p=platform%2Fkernel%2Flinux-rpi.git drm/scheduler: Fix job cleanup without timeout handler After "5918045c4ed4 drm/scheduler: rework job destruction", jobs are only deleted when the timeout handler is able to be cancelled successfully. In case no timeout handler is running (timeout == MAX_SCHEDULE_TIMEOUT), job cleanup would be skipped which may result in memory leaks. Add the handling for the (timeout == MAX_SCHEDULE_TIMEOUT) case in drm_sched_cleanup_jobs. Signed-off-by: Erico Nunes Signed-off-by: Christian König Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/306025/?series=60878&rev=2 --- diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index f8f0e1c..10d1d37 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -630,7 +630,8 @@ static void drm_sched_cleanup_jobs(struct drm_gpu_scheduler *sched) unsigned long flags; /* Don't destroy jobs while the timeout worker is running */ - if (!cancel_delayed_work(&sched->work_tdr)) + if (sched->timeout != MAX_SCHEDULE_TIMEOUT && + !cancel_delayed_work(&sched->work_tdr)) return;