msm: Don't allow overmapping

Due to the way allocations are performed, over mapping must be
disallowed. Otherwise, it may be possible to inadvertently
unmap other physical addresses. The smallest length that can
now be mapped is 4K. Lengths less than 4k can be safely
overmapped since physical addresses must be 4k aligned as well.

Change-Id: I897f479c0cec29d499406b52b624a6f2b34b718a
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
This commit is contained in:
Laura Abbott
2011-07-13 12:39:33 -07:00
committed by Stephen Boyd
parent 3a78e42cf1
commit 27c281a41f

View File

@@ -353,7 +353,7 @@ struct msm_mapped_buffer *msm_subsystem_map_buffer(unsigned long phys,
pg_size = SZ_4K;
for (i = 0; i < ARRAY_SIZE(iommu_page_sizes); i++) {
if ((length > iommu_page_sizes[i]) &&
if (IS_ALIGNED(length, iommu_page_sizes[i]) &&
IS_ALIGNED(phys, iommu_page_sizes[i])) {
pg_size = iommu_page_sizes[i];
break;