diff --git a/arch/arm/mach-msm/subsystem_map.c b/arch/arm/mach-msm/subsystem_map.c index 307531b6470..82f2b6617cc 100644 --- a/arch/arm/mach-msm/subsystem_map.c +++ b/arch/arm/mach-msm/subsystem_map.c @@ -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;