Skip to contentSkip to conversation

drm/imx: fix memory leak when fails to init

PATCH Applied Pan Bian 2 participants 2 messages Jan 20, 2021 – Mar 25, 2021

Subsystems (3)
lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/gpu/drm/imx/imx-drm-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/imx/imx-drm-core.c +1 -1
index d1a9841adeed..e6a88c8cbd69 100644
@@ -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)
Signature · 8 lines
2.17.1



_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel