mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
BACKPORT: msm: mdss: Fix invalid dma attachment during fb shutdown
If DMA attachment fail during fb_mmap, all ION memory will get free. It is necessary to reset the fbmem and fb_attachemnt pointer to NULL, otherwise during shutdown will perform another free and causing issue. CRs-Fixed: 1090244 Bug: 36251984 Change-Id: If998615655f69d9d867d7655d617083d3d9c03eb Signed-off-by: Benjamin Chan <bkchan@codeaurora.org> Signed-off-by: Jonathan Solnit <jsolnit@google.com>
This commit is contained in:
parent
b120be7119
commit
6bebfb8b74
1 changed files with 5 additions and 1 deletions
|
@ -1896,7 +1896,7 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd, size_t fb_size)
|
|||
ion_unmap_iommu(mfd->fb_ion_client, mfd->fb_ion_handle,
|
||||
mfd->mdp.fb_mem_get_iommu_domain(), 0);
|
||||
}
|
||||
goto fb_mmap_failed;
|
||||
goto err_put;
|
||||
}
|
||||
|
||||
pr_debug("alloc 0x%zuB vaddr = %pK (%pa iova) for fb%d\n", fb_size,
|
||||
|
@ -1908,8 +1908,12 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd, size_t fb_size)
|
|||
|
||||
return rc;
|
||||
|
||||
err_put:
|
||||
dma_buf_put(mfd->fbmem_buf);
|
||||
fb_mmap_failed:
|
||||
ion_free(mfd->fb_ion_client, mfd->fb_ion_handle);
|
||||
mfd->fb_ion_handle = NULL;
|
||||
mfd->fbmem_buf = NULL;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue