From patchwork Mon Mar 17 03:28:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 3841221 Return-Path: X-Original-To: patchwork-linux-arm@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 146A79F373 for ; Mon, 17 Mar 2014 03:29:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D4D920149 for ; Mon, 17 Mar 2014 03:29:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 228082012D for ; Mon, 17 Mar 2014 03:29:10 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPOEO-0003Vm-Ly; Mon, 17 Mar 2014 03:28:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPOEM-00066V-78; Mon, 17 Mar 2014 03:28:50 +0000 Received: from mail-pd0-x233.google.com ([2607:f8b0:400e:c02::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WPOEJ-00065d-LX for linux-arm-kernel@lists.infradead.org; Mon, 17 Mar 2014 03:28:48 +0000 Received: by mail-pd0-f179.google.com with SMTP id w10so4976795pde.24 for ; Sun, 16 Mar 2014 20:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=AaIlZJSGml8yDKftNtInI6NDxK/YW5YgyZpBhhU2aZU=; b=if5Za4AQ7FXRsxB9enXm8wiJ071ivzo5AKH3I3n/JPt7PvAx8QvwWtVWjTWAPdlDqu mEhK65VLha7Dbm/o88n6Hyuz93wBUJdU6MmHMxr6chta1495T2RHrP5daLv14cFMUeiC djvEyqprRSHYSIx5ySz+q4fX1wh311WJ69QYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AaIlZJSGml8yDKftNtInI6NDxK/YW5YgyZpBhhU2aZU=; b=WDkxvAag/K0ZMllVS4G0dZ1VxYafoQubVEhbq2MijdxFk7ZsbtJSnZb0eEPAJ9lyvD Pr/fazYV3Zd8d8QI4TjzRreD2iLFuMdcJHcRj+xiXTHfCFOSpb91QGjIRXGzjISEn5G5 3Y5b0sH0s47Uw+9kxDmee6sAv+Me5J5G/E6S+oUoteG2OQ8a8AF35s6xkRU1S8knBERX 5L5jL/Z9uauo37QtZAf49AFFtUuqPQ8NKlCvNLMfG93IrKnyNicN00fySAtu0uAJSDYo SZyNosqlE7dpe8UhCmnbpIi+ZC+zdO/aJEwV7R20vD4+phfY0o8P1VKzDlDulE+dcTyI iwxA== X-Gm-Message-State: ALoCoQmFQvZ2fc+arP1FPkSUlW3g81QSXGBMs59cItA+6Dz8jhdHqx2UQxz/UL604+RsKR/axIE/ X-Received: by 10.68.221.42 with SMTP id qb10mr23513941pbc.65.1395026899182; Sun, 16 Mar 2014 20:28:19 -0700 (PDT) Received: from djkurtz-z620.tpe.corp.google.com (djkurtz-z620.tpe.corp.google.com [172.30.210.61]) by mx.google.com with ESMTPSA id st4sm64861268pab.34.2014.03.16.20.28.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 16 Mar 2014 20:28:17 -0700 (PDT) From: Daniel Kurtz To: Inki Dae , Sachin Kamat Subject: [PATCH] drm/exynos: Fix (more) freeing issues in exynos_drm_drv.c Date: Mon, 17 Mar 2014 11:28:06 +0800 Message-Id: <1395026886-14325-1-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.9.0.279.gdc9e3eb X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140316_232847_776676_AD16EF8C X-CRM114-Status: UNSURE ( 9.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: Kukjin Kim , Joonyoung Shim , David Airlie , Seung-Woo Kim , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Kyungmin Park , linux-samsung-soc@vger.kernel.org, Daniel Kurtz , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The following commit [0] fixed a use-after-free, but left the subdrv open in the error path. [0] commit 6ca605f7c70895a35737435f17ae9cc5e36f1466 drm/exynos: Fix freeing issues in exynos_drm_drv.c Change-Id: I452e944bf090fb11434d9e34213c890c41c15d73 Signed-off-by: Daniel Kurtz --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 215131a..c204b4e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -172,20 +172,24 @@ static int exynos_drm_open(struct drm_device *dev, struct drm_file *file) ret = exynos_drm_subdrv_open(dev, file); if (ret) - goto out; + goto err_file_priv_free; anon_filp = anon_inode_getfile("exynos_gem", &exynos_drm_gem_fops, NULL, 0); if (IS_ERR(anon_filp)) { ret = PTR_ERR(anon_filp); - goto out; + goto err_subdrv_close; } anon_filp->f_mode = FMODE_READ | FMODE_WRITE; file_priv->anon_filp = anon_filp; return ret; -out: + +err_subdrv_close: + exynos_drm_subdrv_close(dev, file); + +err_file_priv_free: kfree(file_priv); file->driver_priv = NULL; return ret;