Skip to content

Commit

Permalink
drm/imx: fix memory leak when fails to init
Browse files Browse the repository at this point in the history
commit 69c3ed7 upstream.

Put DRM device on initialization failure path rather than directly
return error code.

Fixes: a67d508 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
SinkFinder authored and gregkh committed Apr 7, 2021
1 parent 76458eb commit 3f86a8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/imx/imx-drm-core.c
Expand Up @@ -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)
Expand Down

0 comments on commit 3f86a8e

Please sign in to comment.