From patchwork Wed Dec 14 08:16:30 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: 9473841 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 2180E60823 for ; Wed, 14 Dec 2016 08:16:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11ACE286EE for ; Wed, 14 Dec 2016 08:16:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06ACC286F1; Wed, 14 Dec 2016 08:16:36 +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 12176286EE for ; Wed, 14 Dec 2016 08:16:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BACD96E740; Wed, 14 Dec 2016 08:16:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47F5489198 for ; Wed, 14 Dec 2016 08:16:26 +0000 (UTC) Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OI602FC41NB4R90@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 14 Dec 2016 17:16:23 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-cb-5850ffd789cd Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 3A.A6.25310.7DFF0585; Wed, 14 Dec 2016 17:16:23 +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 <0OI600NGO1N90Z00@mmp2.samsung.com>; Wed, 14 Dec 2016 17:16:23 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, robclark@freedesktop.org, inki.dae@samsung.com Subject: [RESEND][PATCH] libkms/exynos: fix memory leak in error path Date: Wed, 14 Dec 2016 17:16:30 +0900 Message-id: <1481703390-30045-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1479101494-12007-1-git-send-email-sw0312.kim@samsung.com> References: <1479101494-12007-1-git-send-email-sw0312.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t9jQd3r/wMiDNbs0LW48vU9m8Weq/eY LCbdn8Bi8eLeRRaLKc25FjMmv2RzYPNYNWcDq8fOWXfZPe53H2fy6NuyijGAJcrNJiM1MSW1 SCE1Lzk/JTMv3VYpNMRN10JJIS8xN9VWKULXNyRISaEsMacUyDMyQAMOzgHuwUr6dgluGe93 z2IteMlSsWXdSfYGxgfMXYycHBICJhLzN3eyQdhiEhfurQeyuTiEBGYxSmzt+MsK4fxglJj8 fBsrSBWbgI7E/iW/wWwRgVCJbUs/MYHYzAK+Es/vTwCbKizgKvGw6z5YnEVAVeJN8wIWEJtX wE3izLwNUJsVJBbcewu2mVPAXeL0nX6wmUJANYuuvmWZwMi7gJFhFaNEakFyQXFSeq5hXmq5 XnFibnFpXrpecn7uJkZwAD+T2sF4cJf7IUYBDkYlHt4FggERQqyJZcWVuYcYJTiYlUR4G/8C hXhTEiurUovy44tKc1KLDzGaAh02kVlKNDkfGF15JfGGJuYm5sYGFuaWliZGSuK8jbOfhQsJ pCeWpGanphakFsH0MXFwSjUwmig4NoTsC+e8wOKm8TqZszyi9ousok/zpBdmqlNevNq0OsEy 6PsqpfjDCnZts7eZW3+q5Lt8e47ftf8rOyInLLWMex69ejnzSQOXTps0a/WEvomxJ8uWHKo2 cn6/M+rilP8/05MnnYyen3+1/OvC+AlHxA/d4LZ6XqL8feqGdqF1kxK0jGvmKLEUZyQaajEX FScCAJMGByp2AgAA X-MTR: 20000000000000000@CPGS Cc: sw0312.kim@samsung.com, emil.l.velikov@gmail.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));