Skip to content

Commit 224a6ac

Browse files
mbrost05Thomas Hellström
authored andcommitted
drm/xe: Do not reference loop variable directly
Do not reference the loop variable job after the loop has exited. Instead, save the job from the last iteration of the loop. Fixes: 3d98a71 ("drm/xe/vf: Start re-emission from first unsignaled job during VF migration") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202511291102.jnnKP6IB-lkp@intel.com/ Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com> Link: https://patch.msgid.link/20251203011809.968893-1-matthew.brost@intel.com (cherry picked from commit 76ce231) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent c88a073 commit 224a6ac

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,10 +2253,11 @@ static void guc_exec_queue_unpause_prepare(struct xe_guc *guc,
22532253
struct xe_exec_queue *q)
22542254
{
22552255
struct xe_gpu_scheduler *sched = &q->guc->sched;
2256-
struct xe_sched_job *job = NULL;
2256+
struct xe_sched_job *job = NULL, *__job;
22572257
bool restore_replay = false;
22582258

2259-
list_for_each_entry(job, &sched->base.pending_list, drm.list) {
2259+
list_for_each_entry(__job, &sched->base.pending_list, drm.list) {
2260+
job = __job;
22602261
restore_replay |= job->restore_replay;
22612262
if (restore_replay) {
22622263
xe_gt_dbg(guc_to_gt(guc), "Replay JOB - guc_id=%d, seqno=%d",

0 commit comments

Comments
 (0)