drm/xe/gt: some error handling fixes
authorMatthew Auld <matthew.auld@intel.com>
Wed, 22 Mar 2023 10:35:45 +0000 (10:35 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:30:21 +0000 (18:30 -0500)
Make sure we pass along the correct errors.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_gt.c

index daa433d0f2f554338a5e2a39ae5bed9b0a397e4b..07464ba427469e0f4f118d161a0169b1b77112b2 100644 (file)
@@ -234,7 +234,7 @@ static int emit_nop_job(struct xe_gt *gt, struct xe_engine *e)
        job = xe_bb_create_wa_job(e, bb, batch_ofs);
        if (IS_ERR(job)) {
                xe_bb_free(bb, NULL);
-               return PTR_ERR(bb);
+               return PTR_ERR(job);
        }
 
        xe_sched_job_arm(job);
@@ -285,7 +285,7 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_engine *e)
        job = xe_bb_create_wa_job(e, bb, batch_ofs);
        if (IS_ERR(job)) {
                xe_bb_free(bb, NULL);
-               return PTR_ERR(bb);
+               return PTR_ERR(job);
        }
 
        xe_sched_job_arm(job);
@@ -545,8 +545,10 @@ static int all_fw_domain_init(struct xe_gt *gt)
 
        if (!xe_gt_is_media_type(gt)) {
                gt->migrate = xe_migrate_init(gt);
-               if (IS_ERR(gt->migrate))
+               if (IS_ERR(gt->migrate)) {
+                       err = PTR_ERR(gt->migrate);
                        goto err_force_wake;
+               }
        } else {
                gt->migrate = xe_find_full_gt(gt)->migrate;
        }