From patchwork Thu Nov 21 03:09:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 3216511 Return-Path: X-Original-To: patchwork-dri-devel@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 A13489F474 for ; Thu, 21 Nov 2013 03:10:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8D0920782 for ; Thu, 21 Nov 2013 03:10:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 650392076C for ; Thu, 21 Nov 2013 03:10:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9904CFCDE4; Wed, 20 Nov 2013 19:10:03 -0800 (PST) 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 0158DFCDE0 for ; Wed, 20 Nov 2013 19:09:54 -0800 (PST) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MWL00CF2FGAUVM0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 21 Nov 2013 12:09:53 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id B1.CB.06969.0897D825; Thu, 21 Nov 2013 12:09:53 +0900 (KST) X-AuditID: cbfee68f-b7f836d000001b39-2d-528d79802a97 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 71.98.09687.0897D825; Thu, 21 Nov 2013 12:09:52 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.75.62]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MWL008GOFGGIHE0@mmp2.samsung.com>; Thu, 21 Nov 2013 12:09:52 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: g2d: fix memory leak to userptr Date: Thu, 21 Nov 2013 12:09:51 +0900 Message-id: <1385003391-19082-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsWyRsSkSLexsjfIYOo/JovecyeZLK58fc9m Men+BBaLs01v2B1YPLZ/e8Dqcb/7OJNH35ZVjAHMUVw2Kak5mWWpRfp2CVwZPas6GAtesFU8 33KatYHxDmsXIyeHhICJRO/xKYwQtpjEhXvr2boYuTiEBJYySpx6tZ0Rpmhe3xpWiMR0RomX H/5COd1MEjuu/GUBqWITUJWYuOI+G4gtImAq0TFpKVicWcBP4sT5lWC2sICNxOknU8FqWIDq 19/cBLaBV8BF4tTFh0xdjBxA2xQk5kyyAZkvIXCfTWL9Loj5LAICEt8mH2KBqJGV2HSAGeI4 SYmDK26wTGAUXMDIsIpRNLUguaA4Kb3IWK84Mbe4NC9dLzk/dxMjMAxP/3vWv4Px7gHrQ4zJ QOMmMkuJJucDwzivJN7Q2MzIwtTE1NjI3NKMNGElcd77D5OChATSE0tSs1NTC1KL4otKc1KL DzEycXBKNTDyNwe2qR8J6jgh99LvoJfi33k+TdPWLzzSvmJZevas8NVLfpatvvQ40s9TfHpn 945zxw4cORj4Nmv5L/vE5cy3IhdMYDrJZrGu+OqP9tPT+RVYj11/eG7/z8xww+inPXtzlx5f Os/AfOvqD1+cfGb+TtrYeX6X8xtX+cKkcuF5+fVHWdbWdXqsVmIpzkg01GIuKk4EAHl4akNZ AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMIsWRmVeSWpSXmKPExsVy+t9jQd2Gyt4gg2d9lha9504yWVz5+p7N YtL9CSwWZ5vesDuweGz/9oDV4373cSaPvi2rGAOYoxoYbTJSE1NSixRS85LzUzLz0m2VvIPj neNNzQwMdQ0tLcyVFPISc1NtlVx8AnTdMnOA9ikplCXmlAKFAhKLi5X07TBNCA1x07WAaYzQ 9Q0JgusxMkADCWsYM3pWdTAWvGCreL7lNGsD4x3WLkZODgkBE4l5fWugbDGJC/fWs3UxcnEI CUxnlHj54S8rhNPNJLHjyl8WkCo2AVWJiSvus4HYIgKmEh2TloLFmQX8JE6cXwlmCwvYSJx+ MhWshgWofv3NTYwgNq+Ai8Spiw+Zuhg5gLYpSMyZZDOBkXsBI8MqRtHUguSC4qT0XEO94sTc 4tK8dL3k/NxNjOAgfya1g3Flg8UhRgEORiUe3o7HPUFCrIllxZW5hxglOJiVRHhjrHuDhHhT EiurUovy44tKc1KLDzEmAy2fyCwlmpwPjMC8knhDYxMzI0sjc0MLI2Nz0oSVxHkPtFoHCgmk J5akZqemFqQWwWxh4uCUamB0z8reeLqq/t/THMfZHw8suruto+5/2MzbU0MqNrWWnLoW+VP5 y6yXdwPvTNvTeyCw5Mfv+utqX3a2yy9awiSfueHlxMT3vaffO27ZP3kBh9GVM5W5FfEvAuPv Gb4/ky8eElfS8Pky68RL4bcay6eenxyZ1KfzfF2xyjqfxm0PGFutzRX2PrfdosRSnJFoqMVc VJwIAIpRn5S2AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: Kyungmin Park 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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 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 This patch releases a vma object when cleaning up userptr resources. A new vma object was allocated and copied when getting userptr pages so the new vma object should be freed properly if the userptr pages aren't used anymore. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 3271fd4..7bccedc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -383,6 +383,8 @@ out: g2d_userptr->npages, g2d_userptr->vma); + exynos_gem_put_vma(g2d_userptr->vma); + if (!g2d_userptr->out_of_list) list_del_init(&g2d_userptr->list);