FAILED: patch "[PATCH] drm/i915/display: Add check for alloc_ordered_workqueue() and" failed to apply to 6.12-stable tree
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x f4c7baa0699b69edb6887a992283b389761e0e81
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025062239-playful-huff-6d2b@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f4c7baa0699b69edb6887a992283b389761e0e81 Mon Sep 17 00:00:00 2001
From: Haoxiang Li <[email protected]>
Date: Fri, 16 May 2025 15:16:54 +0300
Subject: [PATCH] drm/i915/display: Add check for alloc_ordered_workqueue() and
alloc_workqueue()
Add check for the return value of alloc_ordered_workqueue() and alloc_workqueue(). Furthermore, if some allocations fail, cleanup works are added to avoid potential memory leak problem.
drivers/gpu/drm/i915/display/intel_display_driver.c +25 -5
@@ -244,31 +244,45 @@ int intel_display_driver_probe_noirq(struct intel_display *display)intel_dmc_init (display); display->wq.modeset =alloc_ordered_workqueue ("i915_modeset" ,0 ); +if (!display->wq.modeset) { + ret = -ENOMEM ; + goto cleanup_vga_client_pw_domain_dmc; + } + display->wq.flip =alloc_workqueue ("i915_flip" ,WQ_HIGHPRI |WQ_UNBOUND ,WQ_UNBOUND_MAX_ACTIVE ); +if (!display->wq.flip) { + ret = -ENOMEM ; + goto cleanup_wq_modeset; + } + display->wq.cleanup =alloc_workqueue ("i915_cleanup" ,WQ_HIGHPRI ,0 ); +if (!display->wq.cleanup) { + ret = -ENOMEM ; + goto cleanup_wq_flip; + }intel_mode_config_init (display); ret =intel_cdclk_init (display);if (ret) - goto cleanup_vga_client_pw_domain_dmc; + goto cleanup_wq_cleanup; ret =intel_color_init (display);if (ret) - goto cleanup_vga_client_pw_domain_dmc; + goto cleanup_wq_cleanup; ret =intel_dbuf_init (display);if (ret) - goto cleanup_vga_client_pw_domain_dmc; + goto cleanup_wq_cleanup; ret =intel_bw_init (display);if (ret) - goto cleanup_vga_client_pw_domain_dmc; + goto cleanup_wq_cleanup; ret =intel_pmdemand_init (display);if (ret) - goto cleanup_vga_client_pw_domain_dmc; + goto cleanup_wq_cleanup;intel_init_quirks (display);
@@ -276,6 +290,12 @@ int intel_display_driver_probe_noirq(struct intel_display *display)return 0 ; +cleanup_wq_cleanup: +destroy_workqueue (display->wq.cleanup); +cleanup_wq_flip: +destroy_workqueue (display->wq.flip); +cleanup_wq_modeset: +destroy_workqueue (display->wq.modeset); cleanup_vga_client_pw_domain_dmc:intel_dmc_fini (display);intel_power_domains_driver_remove (display);