diff options
author | Inki Dae <inki.dae@samsung.com> | 2013-01-10 23:38:28 -0500 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2013-01-25 00:38:44 -0500 |
commit | 420ae1e2623af92e71437e403fd11de48e11551f (patch) | |
tree | 238e21992b1ecff7c0f79f7633599d4445aeef2c | |
parent | e7808df1af8801cf4f2ac16be25db1b079b5da4c (diff) |
drm/exynos: free sg object if dma_map_sg is failed
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 <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
-rw-r--r-- | 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 9df97714b6c0..693d4bca1518 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 * | |||
110 | nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); | 110 | nents = dma_map_sg(attach->dev, sgt->sgl, sgt->orig_nents, dir); |
111 | if (!nents) { | 111 | if (!nents) { |
112 | DRM_ERROR("failed to map sgl with iommu.\n"); | 112 | DRM_ERROR("failed to map sgl with iommu.\n"); |
113 | sg_free_table(sgt); | ||
113 | sgt = ERR_PTR(-EIO); | 114 | sgt = ERR_PTR(-EIO); |
114 | goto err_unlock; | 115 | goto err_unlock; |
115 | } | 116 | } |