mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
msm: kgsl: Do not release dma and anon buffers if unmap fails
If iommu unmap fails and leaves dma or anon buffers still mapped in the iommu, do not free them. Change-Id: Ice0e1a59c1ac0ee7a9d62d8899966b84fa63d5ca Signed-off-by: Lynus Vaz <quic_lvaz@quicinc.com> Signed-off-by: Deepak Kumar <quic_dkumar@quicinc.com>
This commit is contained in:
parent
fc5843f99a
commit
e7c4bb239b
1 changed files with 6 additions and 0 deletions
|
|
@ -344,6 +344,9 @@ static void kgsl_destroy_ion(struct kgsl_memdesc *memdesc)
|
|||
struct kgsl_mem_entry, memdesc);
|
||||
struct kgsl_dma_buf_meta *meta = entry->priv_data;
|
||||
|
||||
if (memdesc->priv & KGSL_MEMDESC_MAPPED)
|
||||
return;
|
||||
|
||||
if (meta != NULL) {
|
||||
remove_dmabuf_list(meta);
|
||||
dma_buf_unmap_attachment(meta->attach, meta->table,
|
||||
|
|
@ -367,6 +370,9 @@ static void kgsl_destroy_anon(struct kgsl_memdesc *memdesc)
|
|||
struct scatterlist *sg;
|
||||
struct page *page;
|
||||
|
||||
if (memdesc->priv & KGSL_MEMDESC_MAPPED)
|
||||
return;
|
||||
|
||||
for_each_sg(memdesc->sgt->sgl, sg, memdesc->sgt->nents, i) {
|
||||
page = sg_page(sg);
|
||||
for (j = 0; j < (sg->length >> PAGE_SHIFT); j++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue