Commit 65b698bf authored by Christian König's avatar Christian König

drm/sched: add missing NULL check in drm_sched_get_cleanup_job v2

Otherwise we would crash if the job is not resubmitted.

v2: fix second usage of s_fence->parent as well.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarSteven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221004132831.134986-1-christian.koenig@amd.com
parent 7c022f51
...@@ -919,7 +919,8 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) ...@@ -919,7 +919,8 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
job = list_first_entry_or_null(&sched->pending_list, job = list_first_entry_or_null(&sched->pending_list,
struct drm_sched_job, list); struct drm_sched_job, list);
if (job && dma_fence_is_signaled(job->s_fence->parent)) { if (job && (!job->s_fence->parent ||
dma_fence_is_signaled(job->s_fence->parent))) {
/* remove job from pending_list */ /* remove job from pending_list */
list_del_init(&job->list); list_del_init(&job->list);
...@@ -929,7 +930,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched) ...@@ -929,7 +930,7 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
next = list_first_entry_or_null(&sched->pending_list, next = list_first_entry_or_null(&sched->pending_list,
typeof(*next), list); typeof(*next), list);
if (next) { if (next && job->s_fence->parent) {
next->s_fence->scheduled.timestamp = next->s_fence->scheduled.timestamp =
job->s_fence->parent->timestamp; job->s_fence->parent->timestamp;
/* start TO timer for next job */ /* start TO timer for next job */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment