Browse Source

msm: camera: smmu: Remove redundant dma_buf_put

Currently cam_smmu_release_buf_region has a redundant
dma_buf_put, which may cause use after free issue.
Such as when download firmware, will create dma buf and
sysfs_add_workfn will create kobject for the dma buf.
When download firmware fails and then releases the dma
buf, but due to the redundant dma_buf_put will cause
the dma buf is releasd even though the sysfs_add_workfn
is not completed. So when sysfs_add_workfn continue to
access kobject will cause use after free issue. This
commit remove the redundant dma_buf_put.

CRs-Fixed: 3408553
Change-Id: If1e650b7c9b8c41d2a270175ff1a94bb9c58e5b9
Signed-off-by: zhuo <[email protected]>
zhuo 2 years ago
parent
commit
9edd056030
1 changed files with 0 additions and 1 deletions
  1. 0 1
      drivers/cam_smmu/cam_smmu_api.c

+ 0 - 1
drivers/cam_smmu/cam_smmu_api.c

@@ -2594,7 +2594,6 @@ int cam_smmu_release_buf_region(enum cam_smmu_region_id region,
 	dma_buf_unmap_attachment(buf_info->attach,
 		buf_info->table, DMA_BIDIRECTIONAL);
 	dma_buf_detach(buf_info->buf, buf_info->attach);
-	dma_buf_put(buf_info->buf);
 	*is_buf_allocated = false;
 	mutex_unlock(&cb_info->lock);