From patchwork Thu Nov 20 23:54:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 5351441 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 06274C11AC for ; Thu, 20 Nov 2014 23:54:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47A862021B for ; Thu, 20 Nov 2014 23:54:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4CA4120222 for ; Thu, 20 Nov 2014 23:54:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73FF46F2CB; Thu, 20 Nov 2014 15:54:36 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by gabe.freedesktop.org (Postfix) with ESMTP id DBB826F6E8 for ; Thu, 20 Nov 2014 15:54:34 -0800 (PST) Received: by mail-qa0-f47.google.com with SMTP id s7so2665050qap.20 for ; Thu, 20 Nov 2014 15:54:34 -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:in-reply-to:references; bh=gfZ+H5hLpM6Xd9H5RBMa1EkU2+/mH7s6s79mBSOldm4=; b=ZdDwNm+C8JP5rlbNDTyM9tWk+oi/Kt0TLkmMxirbipdpAf1iOvI62K+mbfxPJt+7M7 UQbDKpLSAoH0+XIMDviCGMALztF+8+JDZYNamVSDF6XBnj2L31S7GDI/wKpqbH8PxUYT Zg/hdGWkE2PHa5T36YttRS0jaQK8IvxV/usMahOsKrWXh5hv/FI7QYrdJivkVjALxz// 6ndiut1+dIqmsK1dzr8noqklsJ2Ag+Zp3fBRNvssL1IKFv7Btrho77fdkWa7PGqpSZxS S90JtSpjQ+6uCjjJqNGiX2rnuSOuiz7ZFxGEEJRpr2mNYy/qgFJghzR6tWD1PXHKA75M j5cg== X-Received: by 10.140.48.233 with SMTP id o96mr1612169qga.47.1416527674578; Thu, 20 Nov 2014 15:54:34 -0800 (PST) Received: from localhost.localdomain ([187.34.44.229]) by mx.google.com with ESMTPSA id d2sm3294075qab.24.2014.11.20.15.54.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Nov 2014 15:54:33 -0800 (PST) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 3/3] drm/exynos: avoid leak if exynos_dpi_probe() fails Date: Thu, 20 Nov 2014 21:54:24 -0200 Message-Id: <1416527664-10553-3-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1416527664-10553-1-git-send-email-gustavo@padovan.org> References: <1416527664-10553-1-git-send-email-gustavo@padovan.org> 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 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);