Skip to content

Commit 4246560

Browse files
matt-auldLucas De Marchi
authored andcommitted
drm/xe/guc_submit: fix xa_store() error checking
Looks like we are meant to use xa_err() to extract the error encoded in the ptr. Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Badal Nilawar <badal.nilawar@intel.com> Cc: <stable@vger.kernel.org> # v6.8+ Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241001084346.98516-7-matthew.auld@intel.com (cherry picked from commit f040327) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent e863781 commit 4246560

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ static void __release_guc_id(struct xe_guc *guc, struct xe_exec_queue *q, u32 xa
393393
static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q)
394394
{
395395
int ret;
396-
void *ptr;
397396
int i;
398397

399398
/*
@@ -413,12 +412,10 @@ static int alloc_guc_id(struct xe_guc *guc, struct xe_exec_queue *q)
413412
q->guc->id = ret;
414413

415414
for (i = 0; i < q->width; ++i) {
416-
ptr = xa_store(&guc->submission_state.exec_queue_lookup,
417-
q->guc->id + i, q, GFP_NOWAIT);
418-
if (IS_ERR(ptr)) {
419-
ret = PTR_ERR(ptr);
415+
ret = xa_err(xa_store(&guc->submission_state.exec_queue_lookup,
416+
q->guc->id + i, q, GFP_NOWAIT));
417+
if (ret)
420418
goto err_release;
421-
}
422419
}
423420

424421
return 0;

0 commit comments

Comments
 (0)