The patch below does not apply to the 4.14-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 <stable@xxxxxxxxxxxxxxx>. 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.14.y git checkout FETCH_HEAD git cherry-pick -x ca090c837b430752038b24e56dd182010d77f6f6 # <resolve conflicts, build, test, etc.> git commit -s git send-email --to '<stable@xxxxxxxxxxxxxxx>' --in-reply-to '2023051311-dwarf-botanical-0304@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^.. Possible dependencies: ca090c837b43 ("drm/msm: fix missing wq allocation error handling") dfa70344d1b5 ("Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue"") 643b7d0869cc ("drm/msm: Add missing check and destroy for alloc_ordered_workqueue") 2027e5b3413d ("drm/msm: Initialize MDSS irq domain at probe time") ec919e6e7146 ("drm/msm: Allocate msm_drm_private early and pass it as driver data") 83b965d118cb ("Merge remote-tracking branch 'drm/drm-next' into msm-next-staging") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ca090c837b430752038b24e56dd182010d77f6f6 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Mon, 6 Mar 2023 11:07:19 +0100 Subject: [PATCH] drm/msm: fix missing wq allocation error handling Add the missing sanity check to handle workqueue allocation failures. Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon") Cc: stable@xxxxxxxxxxxxxxx # 3.12 Cc: Rob Clark <robdclark@xxxxxxxxx> Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Patchwork: https://patchwork.freedesktop.org/patch/525102/ Link: https://lore.kernel.org/r/20230306100722.28485-8-johan+linaro@xxxxxxxxxx Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 4d85ca0ba0c1..2a9a363afe50 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -433,6 +433,10 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv) priv->dev = ddev; priv->wq = alloc_ordered_workqueue("msm", 0); + if (!priv->wq) { + ret = -ENOMEM; + goto err_put_dev; + } INIT_LIST_HEAD(&priv->objects); mutex_init(&priv->obj_lock);