drm/xe: Fix NULL check in xe_ggtt_init()

The null check for GT is after calling gt_to_xe, fix it.

Fixes: 3121fed0c5 ("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
This commit is contained in:
Maarten Lankhorst
2024-03-05 21:19:59 -08:00
committed by Matthew Brost
parent 51e9ddc668
commit 2a2e1107ef

View File

@@ -251,7 +251,6 @@ int xe_ggtt_init(struct xe_ggtt *ggtt)
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)