[PATCH 3/3] drm/exynos: avoid leak if exynos_dpi_probe() fails

Gustavo Padovan gustavo at padovan.org
Thu Nov 20 15:54:24 PST 2014


From: Gustavo Padovan <gustavo.padovan at collabora.co.uk>

The component must be deleted if the probe fails.

Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 0673a39..173d135 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -1202,8 +1202,10 @@ static int fimd_probe(struct platform_device *pdev)
 	fimd_manager.ctx = ctx;
 
 	ctx->display = exynos_dpi_probe(dev);
-	if (IS_ERR(ctx->display))
-		return PTR_ERR(ctx->display);
+	if (IS_ERR(ctx->display)) {
+		ret = PTR_ERR(ctx->display);
+		goto err_del_component;
+	}
 
 	pm_runtime_enable(&pdev->dev);
 
-- 
1.9.3



More information about the dri-devel mailing list