Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>,
	stable@vger.kernel.org
Subject: [PATCH] drm/xe: fix error handling in xe_migrate_update_pgtables
Date: Thu, 20 Jun 2024 11:20:26 +0100	[thread overview]
Message-ID: <20240620102025.127699-2-matthew.auld@intel.com> (raw)

Don't call drm_suballoc_free with sa_bo pointing to PTR_ERR.

References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2120
Fixes: dd08ebf6c352 ("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+
---
 drivers/gpu/drm/xe/xe_migrate.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 05f933787860..c9f5673353ee 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -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 +
@@ -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 */
@@ -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);
 }
 
-- 
2.45.1


             reply	other threads:[~2024-06-20 10:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 10:20 Matthew Auld [this message]
2024-06-20 10:57 ` ✓ CI.Patch_applied: success for drm/xe: fix error handling in xe_migrate_update_pgtables Patchwork
2024-06-20 10:57 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-20 10:58 ` ✓ CI.KUnit: success " Patchwork
2024-06-20 11:10 ` ✓ CI.Build: " Patchwork
2024-06-20 11:13 ` ✗ CI.Hooks: failure " Patchwork
2024-06-20 11:14 ` ✓ CI.checksparse: success " Patchwork
2024-06-20 13:11 ` [PATCH] " Thomas Hellström
2024-06-20 14:13 ` ✗ CI.FULL: failure for " Patchwork
2024-06-21  3:28 ` ✓ CI.Patch_applied: success for drm/xe: fix error handling in xe_migrate_update_pgtables (rev2) Patchwork
2024-06-21  3:28 ` ✗ CI.checkpatch: warning " Patchwork
2024-06-21  3:29 ` ✓ CI.KUnit: success " Patchwork
2024-06-21  3:41 ` ✓ CI.Build: " Patchwork
2024-06-21  3:43 ` ✗ CI.Hooks: failure " Patchwork
2024-06-21  3:44 ` ✓ CI.checksparse: success " Patchwork
2024-06-21  4:11 ` ✓ CI.BAT: " Patchwork
2024-06-21  5:35 ` ✗ CI.FULL: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240620102025.127699-2-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox