mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
drm/msm: fix drm device leak on bind errors
commit214b09db61upstream. Make sure to free the DRM device also in case of early errors during bind(). Fixes:2027e5b341("drm/msm: Initialize MDSS irq domain at probe time") Cc: stable@vger.kernel.org # 5.17 Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/525097/ Link: https://lore.kernel.org/r/20230306100722.28485-6-johan+linaro@kernel.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
dd8ce825b1
commit
0fad173f9c
@@ -446,12 +446,12 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
|
||||
|
||||
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);
|
||||
|
||||
@@ -546,6 +546,12 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
|
||||
|
||||
err_msm_uninit:
|
||||
msm_drm_uninit(dev);
|
||||
|
||||
return ret;
|
||||
|
||||
err_put_dev:
|
||||
drm_dev_put(ddev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user