Skip to content

Commit 704c9b5

Browse files
matt-auldgregkh
authored andcommitted
drm/xe: fix error handling in xe_migrate_update_pgtables
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>
1 parent 000099d commit 704c9b5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13361336
GFP_KERNEL, true, 0);
13371337
if (IS_ERR(sa_bo)) {
13381338
err = PTR_ERR(sa_bo);
1339-
goto err;
1339+
goto err_bb;
13401340
}
13411341

13421342
ppgtt_ofs = NUM_KERNEL_PDE +
@@ -1387,7 +1387,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13871387
update_idx);
13881388
if (IS_ERR(job)) {
13891389
err = PTR_ERR(job);
1390-
goto err_bb;
1390+
goto err_sa;
13911391
}
13921392

13931393
/* Wait on BO move */
@@ -1436,12 +1436,12 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
14361436

14371437
err_job:
14381438
xe_sched_job_put(job);
1439+
err_sa:
1440+
drm_suballoc_free(sa_bo, NULL);
14391441
err_bb:
14401442
if (!q)
14411443
mutex_unlock(&m->job_mutex);
14421444
xe_bb_free(bb, NULL);
1443-
err:
1444-
drm_suballoc_free(sa_bo, NULL);
14451445
return ERR_PTR(err);
14461446
}
14471447

0 commit comments

Comments
 (0)