gpu: ion: Free the sgtable for CMA based heaps

When an sgtable is allocated with sg_alloc_table, the table needs
to be destroyed in addition to being freed. Destroy the sgtable
when freeing the associated memory.

Change-Id: Iedba81146ba453070790f071848f86826f7eec9c
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
Laura Abbott 2013-05-16 13:00:08 -07:00 committed by Artem Borisov
parent 5e597b465b
commit d5f76e2f05

View file

@ -115,6 +115,7 @@ static void ion_cma_free(struct ion_buffer *buffer)
dev_dbg(dev, "Release buffer %p\n", buffer);
/* release memory */
dma_free_coherent(dev, buffer->size, info->cpu_addr, info->handle);
sg_free_table(info->table);
/* release sg table */
kfree(info->table);
kfree(info);