drm/imx: fix memory leak when fails to init
authorPan Bian <bianpan2016@163.com>
Wed, 20 Jan 2021 09:16:08 +0000 (01:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 13:00:11 +0000 (15:00 +0200)
commit77a8e6f792d5cfca3c6a30845b069161647d1d55
treec773a475b931b0aed246625524a51b2648e604e4
parent74612ecdf263b48b4ff6779ad3b2cf710372a1b0
drm/imx: fix memory leak when fails to init

commit 69c3ed7282a143439bbc2d03dc00d49c68fcb629 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/imx/imx-drm-core.c