Skip to content

Commit

Permalink
drm/xe: fix error handling in xe_migrate_update_pgtables
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
matt-auld committed Jun 27, 2024
1 parent 406d058 commit ce6b633
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/xe/xe_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
GFP_KERNEL, true, 0);
if (IS_ERR(sa_bo)) {
err = PTR_ERR(sa_bo);
goto err;
goto err_bb;
}

ppgtt_ofs = NUM_KERNEL_PDE +
Expand Down Expand Up @@ -1406,7 +1406,7 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
update_idx);
if (IS_ERR(job)) {
err = PTR_ERR(job);
goto err_bb;
goto err_sa;
}

/* Wait on BO move */
Expand Down Expand Up @@ -1458,10 +1458,10 @@ xe_migrate_update_pgtables(struct xe_migrate *m,

err_job:
xe_sched_job_put(job);
err_sa:
drm_suballoc_free(sa_bo, NULL);
err_bb:
xe_bb_free(bb, NULL);
err:
drm_suballoc_free(sa_bo, NULL);
return ERR_PTR(err);
}

Expand Down

0 comments on commit ce6b633

Please sign in to comment.