From patchwork Mon Nov 24 18:23:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 5368891 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A847D9F4D4 for ; Mon, 24 Nov 2014 18:23:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA72A2026F for ; Mon, 24 Nov 2014 18:23:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C4B13203AD for ; Mon, 24 Nov 2014 18:23:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E27F26E3EF; Mon, 24 Nov 2014 10:23:37 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 28C3F6E01F for ; Mon, 24 Nov 2014 10:23:37 -0800 (PST) Received: by mail-qa0-f43.google.com with SMTP id bm13so6859226qab.30 for ; Mon, 24 Nov 2014 10:23:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=KiWpCLM6aWqkxbw1kkkP6O3seYdK8FbAMqMhGzD20mw=; b=B0K02nKMbr17rBKZCFzu9I+w+iv//lp5ZvgrZryI4inslNhpEYw1KxBtHE8QG4lz1C 4I3wU/z8zMxZ/7kV/BrzHIh5hHteUbvJNcHjL0R34AfN03AIhAn1lcPzZ6w6XnEWroSd D6hg9l6ACUeXEkht8G6Cx5umaxf7lI+juQE3IpY3RPiZjsweRuGfFMduXs/zImEIpkdv 1bIxi5V/ngi7HnM8JHAG6yWv/jdT1uxQ7jF84jSqSe8zbJOcI1jgleOnM+nj35gqo/ut o034qkDaCAbPuvuBEsU/i4haI0nIznST19BAxkLIIDd8r462+e3xmdJvWnfkUwsVLOJF QB4g== X-Received: by 10.224.120.138 with SMTP id d10mr13899006qar.28.1416853416764; Mon, 24 Nov 2014 10:23:36 -0800 (PST) Received: from localhost.localdomain ([187.34.44.229]) by mx.google.com with ESMTPSA id q9sm12516297qat.21.2014.11.24.10.23.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Nov 2014 10:23:35 -0800 (PST) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Subject: [PATCH] drm/exynos: avoid leak if exynos_dpi_probe() fails Date: Mon, 24 Nov 2014 16:23:30 -0200 Message-Id: <1416853410-11369-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 1.9.3 Cc: Gustavo Padovan , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gustavo Padovan The component must be deleted if the probe fails. Signed-off-by: Gustavo Padovan --- 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 1bf52ab..abd2ca9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -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);