Skip to content

Commit c220bce

Browse files
matt-auldsmb49
authored andcommitted
drm/xe: fix error handling in xe_migrate_update_pgtables
BugLink: https://bugs.launchpad.net/bugs/2077600 commit fc932f5 upstream. 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 (cherry picked from commit ce6b633) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent adc5bbf commit c220bce

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
@@ -1325,7 +1325,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13251325
GFP_KERNEL, true, 0);
13261326
if (IS_ERR(sa_bo)) {
13271327
err = PTR_ERR(sa_bo);
1328-
goto err;
1328+
goto err_bb;
13291329
}
13301330

13311331
ppgtt_ofs = NUM_KERNEL_PDE +
@@ -1376,7 +1376,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13761376
update_idx);
13771377
if (IS_ERR(job)) {
13781378
err = PTR_ERR(job);
1379-
goto err_bb;
1379+
goto err_sa;
13801380
}
13811381

13821382
/* Wait on BO move */
@@ -1425,12 +1425,12 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
14251425

14261426
err_job:
14271427
xe_sched_job_put(job);
1428+
err_sa:
1429+
drm_suballoc_free(sa_bo, NULL);
14281430
err_bb:
14291431
if (!q)
14301432
mutex_unlock(&m->job_mutex);
14311433
xe_bb_free(bb, NULL);
1432-
err:
1433-
drm_suballoc_free(sa_bo, NULL);
14341434
return ERR_PTR(err);
14351435
}
14361436

0 commit comments

Comments
 (0)