drm/xe: Fix NULL check in xe_ggtt_init()
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 6 Mar 2024 05:19:59 +0000 (21:19 -0800)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 7 Mar 2024 18:37:55 +0000 (10:37 -0800)
The null check for GT is after calling gt_to_xe, fix it.

Fixes: 3121fed0c51b ("drm/xe: Cleanup some layering in GGTT")
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240306052002.311196-2-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_ggtt.c

index 5e739513ab0aa557094ef40837158e195e133ab0..325337c38961f721a272b7d6290ae2615e21601a 100644 (file)
@@ -251,7 +251,6 @@ err:
 
 static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
 {
-       struct xe_device *xe = gt_to_xe(gt);
        int err;
 
        if (!gt)
@@ -259,7 +258,7 @@ static void ggtt_invalidate_gt_tlb(struct xe_gt *gt)
 
        err = xe_gt_tlb_invalidation_ggtt(gt);
        if (err)
-               drm_warn(&xe->drm, "xe_gt_tlb_invalidation_ggtt error=%d", err);
+               drm_warn(&gt_to_xe(gt)->drm, "xe_gt_tlb_invalidation_ggtt error=%d", err);
 }
 
 void xe_ggtt_invalidate(struct xe_ggtt *ggtt)