Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32ac1a52 authored by Cong Ding's avatar Cong Ding Committed by Rob Clark
Browse files

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
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -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);


	return sg;
out:
out:
	if (ret)
	kfree(sg);
	return ERR_PTR(ret);
	return ERR_PTR(ret);
	return sg;
}
}


static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,
static void omap_gem_unmap_dma_buf(struct dma_buf_attachment *attachment,