Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm: omapdrm: Add missing check for alloc_ordered_workqueue" failed to apply to 4.19-stable tree

PATCH [email protected] 1 participant 1 message Oct 7, 2024

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.19-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-4.19.y
git checkout FETCH_HEAD
git cherry-pick -x e794b7b9b92977365c693760a259f8eef940c536
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024100753-rockfish-ensnare-ca86@gregkh' --subject-prefix 'PATCH 4.19.y' HEAD^..

Possible dependencies:

e794b7b9b929 ("drm: omapdrm: Add missing check for alloc_ordered_workqueue") 2ee767922e1b ("drm/omap: Group CRTC, encoder, connector and dssdev in a structure") ac3b13189333 ("drm/omap: Create all planes before CRTCs")
f96993630445 ("drm/omap: Remove unneeded variable assignments in omap_modeset_init") 845417b3b3b0 ("drm/omap: dss: Move DSS mgr ops and private data to dss_device") f324b2798c87 ("drm/omap: dss: Store dss_device pointer in omap_dss_device") c1dfe721e096 ("drm/omap: dss: Move and rename omap_dss_(get|put)_device()") 67822ae11971 ("drm/omap: dss: Remove panel devices list")
4e0bb06c0b9a ("drm/omap: dss: Split omapdss_register_display()") b9f4d2ebf641 ("drm/omap: dss: Make omap_dss_get_next_device() more generic") 92ce521a4841 ("drm/omap: dss: Rename for_each_dss_dev macro to for_each_dss_display") 7269fde4e8c9 ("drm/omap: displays: Remove input omap_dss_device from panel data") fb5571717c24 ("drm/omap: dss: Move src and dst check and set to connection handlers") 1f507968c30b ("drm/omap: dss: Move debug message and checks to connection handlers") ec727e3f6184 ("drm/omap: dss: Add functions to connect and disconnect devices") b93109d7dc9e ("drm/omap: dss: Move common device operations to common structure") e10bd354ad79 ("drm/omap: dss: Allow looking up any device by port") a7e82a67c1d7 ("drm/omap: dss: Rework output lookup by port node") 9184f8d94c38 ("drm/omap: dss: Create and use omapdss_device_is_registered()") 6a7c5a2200ad ("drm/omap: dss: Create global list of all omap_dss_device instances")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From e794b7b9b92977365c693760a259f8eef940c536 Mon Sep 17 00:00:00 2001
From: Ma Ke <[email protected]>
Date: Thu, 8 Aug 2024 14:13:36 +0800
Subject: [PATCH] drm: omapdrm: Add missing check for alloc_ordered_workqueue

As it may return NULL pointer and cause NULL pointer dereference. Add check for the return value of alloc_ordered_workqueue.

Fixes 2f95bc6d324a ("drm: omapdrm: Perform initialization/cleanup at probe/remove time")
drivers/gpu/drm/omapdrm/omap_drv.c +5 -0
index 6598c9c08ba1..d3eac4817d76 100644
@@ -695,6 +695,10 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	soc = soc_device_match(omapdrm_soc_devices);
 	priv->omaprev = soc ? (uintptr_t)soc->data : 0;
 	priv->wq = alloc_ordered_workqueue("omapdrm", 0);
+	if (!priv->wq) {
+		ret = -ENOMEM;
+		goto err_alloc_workqueue;
+	}
 
 	mutex_init(&priv->list_lock);
 	INIT_LIST_HEAD(&priv->obj_list);
@@ -753,6 +757,7 @@ err_gem_deinit:
 	drm_mode_config_cleanup(ddev);
 	omap_gem_deinit(ddev);
 	destroy_workqueue(priv->wq);
+err_alloc_workqueue:
 	omap_disconnect_pipelines(ddev);
 	drm_dev_put(ddev);
 	return ret;