From patchwork Mon Jul 1 02:17:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 2804881 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 28FE5BF4A1 for ; Mon, 1 Jul 2013 02:42:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED13520116 for ; Mon, 1 Jul 2013 02:42:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C11FC2010C for ; Mon, 1 Jul 2013 02:42:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D53B4E5FDA for ; Sun, 30 Jun 2013 19:42:48 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E094E5C14 for ; Sun, 30 Jun 2013 19:17:03 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MP800DRZJOC1EE0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 01 Jul 2013 11:17:00 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 63.60.17404.C96E0D15; Mon, 01 Jul 2013 11:17:00 +0900 (KST) X-AuditID: cbfee68d-b7f096d0000043fc-ad-51d0e69ca20a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id CB.DC.28381.C96E0D15; Mon, 01 Jul 2013 11:17:00 +0900 (KST) Received: from localhost.localdomain ([10.90.8.56]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MP8007ARJOA2M90@mmp1.samsung.com>; Mon, 01 Jul 2013 11:17:00 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH] drm/exynos: fix not to remain exynos_gem_obj as a leak Date: Mon, 01 Jul 2013 11:17:12 +0900 Message-id: <1372645032-4219-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsWyRsSkRHfOswuBBtcmmVj0njvJZHHl63s2 i0n3J7BYvLh3kcXibNMbdosZk1+yWezdOZnRgd1j+7cHrB73u48zefRtWcUYwBzFZZOSmpNZ llqkb5fAlbH+QRtTwQ2uihU9fA2MfZxdjJwcEgImEs93XmOHsMUkLtxbz9bFyMUhJLCUUeLI 1UWMMEUX+maxQCQWMUr8uLSHGcJpZpI4tvcGK0gVm4COxP4lv8FsEQFLiQdbfzOD2MwCFRKH bv1hArGFBdwlbs/fAhZnEVCVWNzaCRTn4OAVcJWYu9oJYpmCxIJ7b9kg7M9sEns+WEGUC0h8 m3yIBaRcQkBWYtMBZogSSYmDK26wTGAUXMDIsIpRNLUguaA4Kb3IUK84Mbe4NC9dLzk/dxMj MEBP/3vWu4Px9gHrQ4zJQOMmMkuJJucDAzyvJN7Q2MzIwtTE1NjI3NKMNGElcV61FutAIYH0 xJLU7NTUgtSi+KLSnNTiQ4xMHJxSDYyLVi9eVLYv50FGwdkvtz7oCz0y+lZ04KpN+EUhH7eM I8tKj6dLH1pq/tmwacauOQ0uf4rCV4ta3l3hVXjr2hfpQ5OP/djMvy79or7/Xe34B5JsnHsM 62fdUfl+xle5xnrbm/O969pvGU35axrDJ5LOIJhQu+aE6HHfgmsq1zdPEZGf+z/yb3abEktx RqKhFnNRcSIAM11hJWYCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsVy+t9jAd05zy4EGrw9pWXRe+4kk8WVr+/Z LCbdn8Bi8eLeRRaLs01v2C1mTH7JZrF352RGB3aP7d8esHrc7z7O5NG3ZRVjAHNUA6NNRmpi SmqRQmpecn5KZl66rZJ3cLxzvKmZgaGuoaWFuZJCXmJuqq2Si0+ArltmDtB6JYWyxJxSoFBA YnGxkr4dpgmhIW66FjCNEbq+IUFwPUYGaCBhDWPG+gdtTAU3uCpW9PA1MPZxdjFyckgImEhc 6JvFAmGLSVy4t56ti5GLQ0hgEaPEj0t7mCGcZiaJY3tvsIJUsQnoSOxf8hvMFhGwlHiw9Tcz iM0sUCFx6NYfJhBbWMBd4vb8LWBxFgFVicWtnUBxDg5eAVeJuaudIJYpSCy495ZtAiP3AkaG VYyiqQXJBcVJ6bmGesWJucWleel6yfm5mxjBEfBMagfjygaLQ4wCHIxKPLwLpl8IFGJNLCuu zD3EKMHBrCTCu/3z+UAh3pTEyqrUovz4otKc1OJDjMlAyycyS4km5wOjM68k3tDYxMzI0sjc 0MLI2Jw0YSVx3gOt1oFCAumJJanZqakFqUUwW5g4OKUaGN3VNfO1go1bT7Huy5u/VCB6//1g EbFqttO3Lqm/mDbLLSPH2Gydwj7xSQb3ta0Kty/s08gWPenZn59w/AFX79Ylk343+95jWcO0 Nu/ns9OX+04GOcrldn2PDozaJmnK3HlVSmzf7a1bROqreY47LPxYxy8jO+lUll/+EoUlKXLX FJ7fUt1fp8RSnJFoqMVcVJwIAIhXhx3EAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com, yj44.cho@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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: YoungJun Cho The exynos_drm_gem_create() only calls drm_gem_object_release() when exynos_drm_alloc_buf() is failed, and exynos_gem_obj remains as a leak, which is allocated in exynos_drm_gem_init(). So this patch fixes it not to remain as a leak. Signed-off-by: YoungJun Cho Signed-off-by: Seung-Woo Kim Signed-off-by: Kyungmin Park --- This patch is based on exynos-drm-next branch. drivers/gpu/drm/exynos/exynos_drm_gem.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index c3f15e7..24c22a8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -246,13 +246,14 @@ struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev, exynos_gem_obj->flags = flags; ret = exynos_drm_alloc_buf(dev, buf, flags); - if (ret < 0) { - drm_gem_object_release(&exynos_gem_obj->base); - goto err_fini_buf; - } + if (ret < 0) + goto err_gem_fini; return exynos_gem_obj; +err_gem_fini: + drm_gem_object_release(&exynos_gem_obj->base); + kfree(exynos_gem_obj); err_fini_buf: exynos_drm_fini_buf(dev, buf); return ERR_PTR(ret);