From patchwork Mon Nov 14 05:31:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 9426505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F28D60471 for ; Mon, 14 Nov 2016 05:30:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 265302882C for ; Mon, 14 Nov 2016 05:30:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17425288F3; Mon, 14 Nov 2016 05:30:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7A3852882C for ; Mon, 14 Nov 2016 05:30:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90C2E6E109; Mon, 14 Nov 2016 05:30:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 708BB6E10B for ; Mon, 14 Nov 2016 05:30:50 +0000 (UTC) Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGM01CSX9Z4KPA0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 14 Nov 2016 14:30:47 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-5a-58294c07230b Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id C4.75.25310.70C49285; Mon, 14 Nov 2016 14:30:47 +0900 (KST) Received: from localhost.localdomain ([10.113.62.209]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OGM009829ZABJ90@mmp2.samsung.com>; Mon, 14 Nov 2016 14:30:47 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, robclark@freedesktop.org, inki.dae@samsung.com Subject: [PATCH libdrm] libkms/exynos: fix memory leak in error path Date: Mon, 14 Nov 2016 14:31:34 +0900 Message-id: <1479101494-12007-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t9jQV12H80Ig8U39S2ufH3PZjHp/gQW ixf3LrJYTGnOtZgx+SWbA6vHqjkbWD3udx9n8ujbsooxgDnKzSYjNTEltUghNS85PyUzL91W KTTETddCSSEvMTfVVilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhnvd89iLXjJUrFl3Un2 BsYHzF2MHBwSAiYS53YYdTFyApliEhfurWfrYuTiEBKYxShx7ek2VgjnB6PE9Q2fWUGq2AR0 JPYv+Q1miwiESmxb+okJZBCzgLHE3UvOIGFhAReJ/w/msYDYLAKqEse2/wOzeQXcJKYtO8gM sUxBYsG9t2wTGLkXMDKsYpRILUguKE5KzzXMSy3XK07MLS7NS9dLzs/dxAgOvGdSOxgP7nI/ xCjAwajEw3vATDNCiDWxrLgy9xCjBAezkgivqw1QiDclsbIqtSg/vqg0J7X4EKMp0AETmaVE k/OBUZFXEm9oYm5ibmxgYW5paWKkJM7bOPtZuJBAemJJanZqakFqEUwfEwenVAOjKofPvnnG a6T+qk/WyDlofOj8e+7QlXpv9DU/c7iYpEoZSJpNCJa+vIdzVqie4Mk/j1sNHyy3M1EON39g K2B2vOuY0fMI5teiHWtj795Se+URNvVSnUzIvsxIv/SjUrI1V4/EizW//GbPvUMn/OC/xt0X Dq3Km/ZN1e9RfOi31g9XWXcd+j9FiaU4I9FQi7moOBEASD5qClICAAA= X-MTR: 20000000000000000@CPGS Cc: sw0312.kim@samsung.com 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-Virus-Scanned: ClamAV using ClamSMTP This patch fixes memory leak in error path of exynos_bo_create(). Signed-off-by: Seung-Woo Kim --- libkms/exynos.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/libkms/exynos.c b/libkms/exynos.c index 5de2e5a..0e97fb5 100644 --- a/libkms/exynos.c +++ b/libkms/exynos.c @@ -88,7 +88,8 @@ exynos_bo_create(struct kms_driver *kms, pitch = (pitch + 512 - 1) & ~(512 - 1); size = pitch * ((height + 4 - 1) & ~(4 - 1)); } else { - return -EINVAL; + ret = -EINVAL; + goto err_free; } memset(&arg, 0, sizeof(arg));