Skip to content

Commit ce6b633

Browse files
committed
drm/xe: fix error handling in xe_migrate_update_pgtables
Don't call drm_suballoc_free with sa_bo pointing to PTR_ERR. References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2120 Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: <stable@vger.kernel.org> # v6.8+ Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240620102025.127699-2-matthew.auld@intel.com
1 parent 406d058 commit ce6b633

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13581358
GFP_KERNEL, true, 0);
13591359
if (IS_ERR(sa_bo)) {
13601360
err = PTR_ERR(sa_bo);
1361-
goto err;
1361+
goto err_bb;
13621362
}
13631363

13641364
ppgtt_ofs = NUM_KERNEL_PDE +
@@ -1406,7 +1406,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
14061406
update_idx);
14071407
if (IS_ERR(job)) {
14081408
err = PTR_ERR(job);
1409-
goto err_bb;
1409+
goto err_sa;
14101410
}
14111411

14121412
/* Wait on BO move */
@@ -1458,10 +1458,10 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
14581458

14591459
err_job:
14601460
xe_sched_job_put(job);
1461+
err_sa:
1462+
drm_suballoc_free(sa_bo, NULL);
14611463
err_bb:
14621464
xe_bb_free(bb, NULL);
1463-
err:
1464-
drm_suballoc_free(sa_bo, NULL);
14651465
return ERR_PTR(err);
14661466
}
14671467

0 commit comments

Comments
 (0)