From patchwork Fri Jan 11 05:12:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1963601 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id AB073DF2A2 for ; Fri, 11 Jan 2013 05:12:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77F39E69B0 for ; Thu, 10 Jan 2013 21:12:49 -0800 (PST) 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 ESMTP id 441C9E64BE for ; Thu, 10 Jan 2013 21:12:20 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGG008W93RPKD30@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 11 Jan 2013 14:12:18 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.42]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 63.EF.12699.23F9FE05; Fri, 11 Jan 2013 14:12:18 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-1b-50ef9f320e08 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 03.EF.12699.23F9FE05; Fri, 11 Jan 2013 14:12:18 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MGG00AUM3SIIH60@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 11 Jan 2013 14:12:18 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: free sg object if dma_map_sg is failed Date: Fri, 11 Jan 2013 14:12:17 +0900 Message-id: <1357881137-14912-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMLMWRmVeSWpSXmKPExsVy+t8zLV2j+e8DDGb/NLO48vU9mwOjx/3u 40wBjFFcNimpOZllqUX6dglcGTdubmEteMhe0f3yEUsD4wm2LkZODgkBE4lTU+6wQ9hiEhfu rQeKc3EICSxjlJjc+Q+u6O32nVCJ6YwShxo/MIEkhATWM0mcOxkFYrMJqEpMXHEfrEFEwFSi Y9JSFhCbWaBQYmHPUyCbg0NYwFmivZsLJMwCVN63Zw5YOa+Ai8Su6x2sELsUJBbce8sGUSMg 8W3yIbBWCQFZiU0HmEFOkBDYwiYxZfs7qHpJiYMrbrBMYBRcwMiwilE0tSC5oDgpPddIrzgx t7g0L10vOT93EyMkpKR3MK5qsDjEKMDBqMTDW6n5PkCINbGsuDL3EKMEB7OSCG9NLVCINyWx siq1KD++qDQntfgQow/QJROZpUST84HhnlcSb2hsYGxoaGloZmppaoBDWEmcl/HUkwAhgfTE ktTs1NSC1CKYcUwcnFINjCX1TXukxaOqFys+4ll0/vONDZNP3jX799bbuWFe7geL83YmDoaf DwsxPfudo+jZX+iy/bP85MvRoZZ7vX9c+Vwqfzuhfp2s317lqJXeyQ5vGGbqzltQd4P/7P6m q9oJtk92Wcxpv/TN1Eyv/vyTGbrdUQ2NohsK25+0STNuX3vh+ZmYzWl//JRYijMSDbWYi4oT ASc2ZJlWAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsVy+t9jQV2j+e8DDPbcNbC48vU9mwOjx/3u 40wBjFENjDYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5 QGOVFMoSc0qBQgGJxcVK+naYJoSGuOlawDRG6PqGBMH1GBmggYR1jBk3bm5hLXjIXtH98hFL A+MJti5GTg4JAROJt9t3QtliEhfurQeyuTiEBKYzShxq/MAEkhASWM8kce5kFIjNJqAqMXHF fbAGEQFTiY5JS1lAbGaBQomFPU+BbA4OYQFnifZuLpAwC1B53545YOW8Ai4Su653sELsUpBY cO8t2wRG7gWMDKsYRVMLkguKk9JzjfSKE3OLS/PS9ZLzczcxggP2mfQOxlUNFocYBTgYlXh4 KzXfBwixJpYVV+YeYpTgYFYS4a2pBQrxpiRWVqUW5ccXleakFh9i9AHaPpFZSjQ5HxhNeSXx hsYmZkaWRmbGJubGxjiElcR5GU89CRASSE8sSc1OTS1ILYIZx8TBKdXAqPjdQThC2srwvp3Z vBq/UyEOLBd1PF5wKGTeujFX4zz3Um6VXQ4zNgpsVqxOCiuoSy7a0JS2ymLfCgGTFxPv1XOF vg/rljh50Wm9VyrHn80PGH7dqWmODTzBHjb9WsoLcQerkFyTcu3qaglDUemT1+z0curcfifs tpiW/U6u51/qEuvS5VZKLMUZiYZazEXFiQBJEttihQIAAA== X-CFilter-Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@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 This patch releases sgt's sg object allocated by sgt_alloc_table correctly. When exynos_gem_map_dma_buf was called by dma_buf_map_attachmemt(), the sgt's sg object was allocated by sg_alloc_tale() so if dma_map_sg() is failed, the sg object should be released. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_dmabuf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c index 9df9771..693d4bc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dmabuf.c @@ -110,6 +110,7 @@ static struct sg_table * nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); if (!nents) { DRM_ERROR("failed to map sgl with iommu.\n"); + sg_free_table(sgt); sgt = ERR_PTR(-EIO); goto err_unlock; }