All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: fix error handling in intel_display_driver_probe_noirq
@ 2026-06-30  3:16 yaolu
  2026-06-30  3:22 ` sashiko-bot
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: yaolu @ 2026-06-30  3:16 UTC (permalink / raw)
  To: jani.nikula, rodrigo.vivi, joonas.lahtinen, tursulin
  Cc: intel-gfx, dri-devel, linux-kernel, Lu Yao

From: Lu Yao <yaolu@kylinos.cn>

Fix two bugs in the probe error path:

1. intel_dmc_fini() was called on workqueue alloc failed paths but
   intel_dmc_init() had been invoked.  Move the dmc init call advance.

2. If intel_mode_config_init() succeeded, after intel_xxx_init()
   failed leaked the resources allocated by drm_mode_config_init().
   Add a cleanup_mode_config label.

Signed-off-by: Lu Yao <yaolu@kylinos.cn>
---
 .../drm/i915/display/intel_display_driver.c    | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index d0729936f681..d69bdfb19efe 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -223,6 +223,8 @@ int intel_display_driver_probe_noirq(struct intel_display *display)
 	if (!HAS_DISPLAY(display))
 		return 0;
 
+	intel_dmc_init(display);
+
 	display->hotplug.dp_wq = alloc_ordered_workqueue("intel-dp", 0);
 	if (!display->hotplug.dp_wq) {
 		ret = -ENOMEM;
@@ -254,33 +256,31 @@ int intel_display_driver_probe_noirq(struct intel_display *display)
 		goto cleanup_wq_cleanup;
 	}
 
-	intel_dmc_init(display);
-
 	intel_mode_config_init(display);
 
 	ret = intel_cdclk_init(display);
 	if (ret)
-		goto cleanup_wq_unordered;
+		goto cleanup_mode_config;
 
 	ret = intel_color_init(display);
 	if (ret)
-		goto cleanup_wq_unordered;
+		goto cleanup_mode_config;
 
 	ret = intel_dbuf_init(display);
 	if (ret)
-		goto cleanup_wq_unordered;
+		goto cleanup_mode_config;
 
 	ret = intel_dbuf_bw_init(display);
 	if (ret)
-		goto cleanup_wq_unordered;
+		goto cleanup_mode_config;
 
 	ret = intel_bw_init(display);
 	if (ret)
-		goto cleanup_wq_unordered;
+		goto cleanup_mode_config;
 
 	ret = intel_pmdemand_init(display);
 	if (ret)
-		goto cleanup_wq_unordered;
+		goto cleanup_mode_config;
 
 	intel_init_quirks(display);
 
@@ -288,6 +288,8 @@ int intel_display_driver_probe_noirq(struct intel_display *display)
 
 	return 0;
 
+cleanup_mode_config:
+	intel_mode_config_cleanup(display);
 cleanup_wq_unordered:
 	destroy_workqueue(display->wq.unordered);
 cleanup_wq_cleanup:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-02 15:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  3:16 [PATCH] drm/i915/display: fix error handling in intel_display_driver_probe_noirq yaolu
2026-06-30  3:22 ` sashiko-bot
2026-06-30 10:12 ` Jani Nikula
2026-07-01  1:15 ` [PATCH v2] " yaolu
2026-07-02  1:12   ` [PATCH v3] " yaolu
2026-07-01 23:37 ` ✗ Fi.CI.BUILD: failure for drm/i915/display: fix error handling in intel_display_driver_probe_noirq (rev2) Patchwork
2026-07-02 15:49 ` ✗ i915.CI.BAT: failure for drm/i915/display: fix error handling in intel_display_driver_probe_noirq (rev3) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.