From patchwork Wed Mar 13 09:03:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 2262411 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 634313FD8C for ; Wed, 13 Mar 2013 09:05:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3F52E5FB5 for ; Wed, 13 Mar 2013 02:05:47 -0700 (PDT) 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 3E5D0E67FF for ; Wed, 13 Mar 2013 02:03:51 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJL00LA4D5NPGV0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 13 Mar 2013 18:03:50 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.41]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 14.8B.05174.6F040415; Wed, 13 Mar 2013 18:03:50 +0900 (KST) X-AuditID: cbfee68f-b7f4a6d000001436-be-514040f66f23 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4F.41.13494.6F040415; Wed, 13 Mar 2013 18:03:50 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.8.53]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJL00ERYD6E2J30@mmp1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 13 Mar 2013 18:03:50 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 1/7] drm/exynos: Fix error routine to getting dma addr. Date: Wed, 13 Mar 2013 18:03:49 +0900 Message-id: <1363165429-7380-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsVy+t8zTd1vDg6BBg23VC2ufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxpk3N5kLPnFW/P48nb2BcR1HFyMnh4SAicSSR8tZIWwxiQv3 1rN1MXJxCAksY5RYe+M5I0zRumn/WSASixgllmztYYRw1jFJzDq0lBmkik1AVWLiivtsILaI gKlEx6SlYB3MAt2MEs8f/AXbISzgLnFjQwfYWBaghm3LXrOD2LwCzhKz1+xjgVinILHg3luw OyQE9rBJ9OyfxQrRICDxbfIhoCIOoISsxKYDzBD1khIHV9xgmcAouICRYRWjaGpBckFxUnqR sV5xYm5xaV66XnJ+7iZGSGD172C8e8D6EGMy0LiJzFKiyfnAwMwriTc0NjOyMDUxNTYytzQj TVhJnFetxTpQSCA9sSQ1OzW1ILUovqg0J7X4ECMTB6dUA2O8aNWkG8lOYWEHft0QV/ztd/lJ 8Clxsf3fp62d7rm+a6HW9rmZcr3azK3pPDvV//HmXQg6dJbx6ckJqjyGOppeK38+DdzYsFmm tzPV1LG4pCk8NytfK2Cu/97I0h+m+2p+T9+iEVg42b3slVRoUv7Z9UJ9u/YzT3zEV14Zc++4 qcuvUtbjJkosxRmJhlrMRcWJANOKF/9CAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeLIzCtJLcpLzFFi42I5/e+xgO43B4dAgz3L5CyufH3P5sDocb/7 OFMAY1QDo01GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO 0FglhbLEnFKgUEBicbGSvh2mCaEhbroWMI0Rur4hQXA9RgZoIGEdY8aZNzeZCz5xVvz+PJ29 gXEdRxcjJ4eEgInEumn/WSBsMYkL99azdTFycQgJLGKUWLK1hxHCWcckMevQUmaQKjYBVYmJ K+6zgdgiAqYSHZOWsoAUMQt0M0o8f/CXFSQhLOAucWNDByOIzQLUsG3Za3YQm1fAWWL2mn1Q 6xQkFtx7yzaBkXsBI8MqRtHUguSC4qT0XCO94sTc4tK8dL3k/NxNjOCwfSa9g3FVg8UhRgEO RiUeXok0+0Ah1sSy4srcQ4wSHMxKIrzfbBwChXhTEiurUovy44tKc1KLDzEmA22fyCwlmpwP jKm8knhDYxMzI0sjM2MTc2Nj0oSVxHkPtloHCgmkJ5akZqemFqQWwWxh4uCUamDMm3i6S9Dr GN+vTf/Oun2u93h7qVZkqXDKladbLPeY67hKSs0Q0mz2P9LcpPCK6+5CJs4TXsoPJdh92lPT 7dY6uVi8lrL7dC02iGnnW6ebDYcn3XH6oXryTdK89zsv5KkVGJd4/FqeecXSvmvqi02C564d qv85kfWqHu+z9fZe96LTDRefnhahxFKckWioxVxUnAgAio4pN58CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS 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 From: YoungJun Cho This patch fixes error routine when g2d_userptr_get_dma_add is failed. When sg_alloc_table_from_pages() is failed, it doesn't call sg_free_table() anymore. Signed-off-by: YoungJun Cho Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 3b0da03..28b7112 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -450,7 +450,7 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, DMA_BIDIRECTIONAL); if (ret < 0) { DRM_ERROR("failed to map sgt with dma region.\n"); - goto err_free_sgt; + goto err_sg_free_table; } g2d_userptr->dma_addr = sgt->sgl[0].dma_address; @@ -467,8 +467,10 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev, return &g2d_userptr->dma_addr; -err_free_sgt: +err_sg_free_table: sg_free_table(sgt); + +err_free_sgt: kfree(sgt); sgt = NULL;