summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/imx
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2021-01-20 01:16:08 -0800
committerPhilipp Zabel <p.zabel@pengutronix.de>2021-03-25 07:43:42 +0100
commit69c3ed7282a143439bbc2d03dc00d49c68fcb629 (patch)
treef68bbcf2fe937a3fad7a29ec2cdb1935e58657e1 /drivers/gpu/drm/imx
parenta38fd8748464831584a19438cbb3082b5a2dab15 (diff)
drm/imx: fix memory leak when fails to init
Put DRM device on initialization failure path rather than directly return error code. Fixes: a67d5088ceb8 ("drm/imx: drop explicit drm_mode_config_cleanup") Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/imx')
-rw-r--r--drivers/gpu/drm/imx/imx-drm-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index d1a9841adeed..e6a88c8cbd69 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -215,7 +215,7 @@ static int imx_drm_bind(struct device *dev)
ret = drmm_mode_config_init(drm);
if (ret)
- return ret;
+ goto err_kms;
ret = drm_vblank_init(drm, MAX_CRTC);
if (ret)