mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 23:29:10 -04:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4ee723a96f
commit
cce17b457b
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user