drm/exynos: avoid leak if exynos_dpi_probe() fails
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 24 Nov 2014 18:23:30 +0000 (16:23 -0200)
committerInki Dae <inki.dae@samsung.com>
Tue, 25 Nov 2014 02:58:43 +0000 (11:58 +0900)
The component must be deleted if the probe fails.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_fimd.c

index ef80a3537f3540fefa95bbd6d488010c24af842f..e5810d13bf9c5377b9faa5afc0fc333bd6d2ab17 100644 (file)
@@ -1215,8 +1215,10 @@ static int fimd_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, 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(dev);