mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
drm/msm: fix drm device leak on bind errors
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>
This commit is contained in:
committed by
Dmitry Baryshkov
parent
cd459c005d
commit
214b09db61
@@ -445,12 +445,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);
|
||||
|
||||
@@ -545,6 +545,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