This is a note to let you know that I've just added the patch titled drm/msm: fix drm device leak on bind errors to the 6.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-msm-fix-drm-device-leak-on-bind-errors.patch and it can be found in the queue-6.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 214b09db61978497df24efcb3959616814bca46b Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Mon, 6 Mar 2023 11:07:17 +0100 Subject: drm/msm: fix drm device leak on bind errors From: Johan Hovold <johan+linaro@xxxxxxxxxx> commit 214b09db61978497df24efcb3959616814bca46b upstream. Make sure to free the DRM device also in case of early errors during bind(). Fixes: 2027e5b3413d ("drm/msm: Initialize MDSS irq domain at probe time") Cc: stable@xxxxxxxxxxxxxxx # 5.17 Cc: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Patchwork: https://patchwork.freedesktop.org/patch/525097/ Link: https://lore.kernel.org/r/20230306100722.28485-6-johan+linaro@xxxxxxxxxx Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/msm/msm_drv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -443,12 +443,12 @@ static int msm_drm_init(struct device *d ret = msm_init_vram(ddev); if (ret) - return ret; + goto err_put_dev; /* Bind all our sub-components: */ ret = component_bind_all(dev, ddev); if (ret) - return ret; + goto err_put_dev; dma_set_max_seg_size(dev, UINT_MAX); @@ -543,6 +543,12 @@ static int msm_drm_init(struct device *d err_msm_uninit: msm_drm_uninit(dev); + + return ret; + +err_put_dev: + drm_dev_put(ddev); + return ret; } Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are queue-6.2/drm-msm-fix-vram-leak-on-bind-errors.patch queue-6.2/drm-msm-adreno-fix-runtime-pm-imbalance-at-gpu-load.patch queue-6.2/drm-msm-fix-workqueue-leak-on-bind-errors.patch queue-6.2/drm-msm-fix-drm-device-leak-on-bind-errors.patch queue-6.2/drm-msm-fix-missing-wq-allocation-error-handling.patch queue-6.2/drm-msm-fix-null-deref-on-irq-uninstall.patch queue-6.2/usb-dwc3-gadget-drop-dead-hibernation-code.patch queue-6.2/drm-msm-fix-null-deref-on-snapshot-tear-down.patch