Browse Source

Merge "msm: camera: memmgr: fix lack of condition lead to memory leak" into camera-kernel.lnx.4.0

Camera Software Integration 4 years ago
parent
commit
028446bc80
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/cam_req_mgr/cam_mem_mgr.c

+ 2 - 2
drivers/cam_req_mgr/cam_mem_mgr.c

@@ -626,10 +626,10 @@ static int cam_mem_util_map_hw_va(uint32_t flags,
 	return rc;
 	return rc;
 multi_map_fail:
 multi_map_fail:
 	if (flags & CAM_MEM_FLAG_PROTECTED_MODE)
 	if (flags & CAM_MEM_FLAG_PROTECTED_MODE)
-		for (--i; i > 0; i--)
+		for (--i; i >= 0; i--)
 			cam_smmu_unmap_stage2_iova(mmu_hdls[i], fd);
 			cam_smmu_unmap_stage2_iova(mmu_hdls[i], fd);
 	else
 	else
-		for (--i; i > 0; i--)
+		for (--i; i >= 0; i--)
 			cam_smmu_unmap_user_iova(mmu_hdls[i],
 			cam_smmu_unmap_user_iova(mmu_hdls[i],
 				fd,
 				fd,
 				CAM_SMMU_REGION_IO);
 				CAM_SMMU_REGION_IO);