Skip to content

Commit fc932f5

Browse files
matt-auldThomas Hellström
authored andcommitted
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 <[email protected]> Cc: Thomas Hellström <[email protected]> Cc: Matthew Brost <[email protected]> Cc: <[email protected]> # v6.8+ Reviewed-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit ce6b633) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 22a40d1 commit fc932f5

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
@@ -1334,7 +1334,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13341334
GFP_KERNEL, true, 0);
13351335
if (IS_ERR(sa_bo)) {
13361336
err = PTR_ERR(sa_bo);
1337-
goto err;
1337+
goto err_bb;
13381338
}
13391339

13401340
ppgtt_ofs = NUM_KERNEL_PDE +
@@ -1385,7 +1385,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13851385
update_idx);
13861386
if (IS_ERR(job)) {
13871387
err = PTR_ERR(job);
1388-
goto err_bb;
1388+
goto err_sa;
13891389
}
13901390

13911391
/* Wait on BO move */
@@ -1434,12 +1434,12 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
14341434

14351435
err_job:
14361436
xe_sched_job_put(job);
1437+
err_sa:
1438+
drm_suballoc_free(sa_bo, NULL);
14371439
err_bb:
14381440
if (!q)
14391441
mutex_unlock(&m->job_mutex);
14401442
xe_bb_free(bb, NULL);
1441-
err:
1442-
drm_suballoc_free(sa_bo, NULL);
14431443
return ERR_PTR(err);
14441444
}
14451445

0 commit comments

Comments
 (0)