提交 32ac1a52 编写于 作者: C Cong Ding 提交者: Rob Clark

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: NCong Ding <dinggnu@gmail.com>
Signed-off-by: NRob Clark <rob@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 238083ad
...@@ -53,10 +53,10 @@ static struct sg_table *omap_gem_map_dma_buf( ...@@ -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 */ /* this should be after _get_paddr() to ensure we have pages attached */
omap_gem_dma_sync(obj, dir); omap_gem_dma_sync(obj, dir);
out:
if (ret)
return ERR_PTR(ret);
return sg; return sg;
out:
kfree(sg);
return ERR_PTR(ret);
} }
static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment, static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册