summaryrefslogtreecommitdiffstats
path: root/drivers/staging/omapdrm
diff options
context:
space:
mode:
authorCong Ding <dinggnu@gmail.com>2013-01-15 20:46:50 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 13:19:55 -0800
commitcce17b457b3b346e5777ec770feb324663ea2b9b (patch)
treeff56fc0ed4bab466e946fd7dc35c400de919a53d /drivers/staging/omapdrm
parent4ee723a96f9313d67e88c7a9d3ae6162d2308f2d (diff)
downloadop-kernel-dev-cce17b457b3b346e5777ec770feb324663ea2b9b.zip
op-kernel-dev-cce17b457b3b346e5777ec770feb324663ea2b9b.tar.gz
staging: omapdrm/omap_gem_dmabuf.c: fix memory leakage
There is a memory leakage in variable sg if it goes to error. Signed-off-by: Cong Ding <dinggnu@gmail.com> Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/omapdrm')
-rw-r--r--drivers/staging/omapdrm/omap_gem_dmabuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/omapdrm/omap_gem_dmabuf.c b/drivers/staging/omapdrm/omap_gem_dmabuf.c
index eabb8b5..27780b8 100644
--- a/drivers/staging/omapdrm/omap_gem_dmabuf.c
+++ b/drivers/staging/omapdrm/omap_gem_dmabuf.c
@@ -53,10 +53,10 @@ static struct sg_table *omap_gem_map_dma_buf(
/* this should be after _get_paddr() to ensure we have pages attached */
omap_gem_dma_sync(obj, dir);
-out:
- if (ret)
- return ERR_PTR(ret);
return sg;
+out:
+ kfree(sg);
+ return ERR_PTR(ret);
}
static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
OpenPOWER on IntegriCloud