aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorCong Ding <dinggnu@gmail.com>2013-01-15 20:46:50 +0100
committerRob Clark <robdclark@gmail.com>2013-02-16 17:38:05 -0500
commit32ac1a5286d56b3c822f4a1a8d0f7fc5d586de38 (patch)
treebe3e30e91e66f5680b70dead956f42ae26548eca /drivers/staging
parent238083ad5d67d1c9ba6e7158a027e834a48bb23b (diff)
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')
-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 b6c5b5c6c8c..a3236abfca3 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,