Commit 32ac1a52 authored by Cong Ding's avatar Cong Ding Committed by 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: default avatarCong Ding <dinggnu@gmail.com>
Signed-off-by: default avatarRob Clark <rob@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 238083ad
......@@ -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);
return sg;
out:
if (ret)
kfree(sg);
return ERR_PTR(ret);
return sg;
}
static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment