]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Clear xe->display when no longer valid
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 15 Apr 2026 21:04:06 +0000 (00:04 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 16 Apr 2026 16:24:22 +0000 (19:24 +0300)
Don't leave a stale xe->display pointer hanging around after
the display driver has been torn down.

While xe shouldn't hit the display reset related issue that
affects i915, leaving stale pointer floating around still
seems like a bad idea.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260415210411.24750-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/xe/display/xe_display.c

index 00dfa68af29aaf5e6781cf102b7de09c6f8b9396..0747044f7c2a74f0180a85b47ed609e19e8b0b62 100644 (file)
@@ -520,9 +520,10 @@ void xe_display_pm_runtime_resume(struct xe_device *xe)
 
 static void display_device_remove(struct drm_device *dev, void *arg)
 {
-       struct intel_display *display = arg;
+       struct xe_device *xe = arg;
 
-       intel_display_device_remove(display);
+       intel_display_device_remove(xe->display);
+       xe->display = NULL;
 }
 
 static bool irq_enabled(struct drm_device *drm)
@@ -587,12 +588,12 @@ int xe_display_probe(struct xe_device *xe)
        if (IS_ERR(display))
                return PTR_ERR(display);
 
-       err = drmm_add_action_or_reset(&xe->drm, display_device_remove, display);
+       xe->display = display;
+
+       err = drmm_add_action_or_reset(&xe->drm, display_device_remove, xe);
        if (err)
                return err;
 
-       xe->display = display;
-
        if (intel_display_device_present(display))
                return 0;