diff options
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index c27447653903..e315dfe3af1b 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -2027,6 +2027,13 @@ static bool arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size, | |||
2027 | if (!iommu) | 2027 | if (!iommu) |
2028 | return false; | 2028 | return false; |
2029 | 2029 | ||
2030 | /* | ||
2031 | * currently arm_iommu_create_mapping() takes a max of size_t | ||
2032 | * for size param. So check this limit for now. | ||
2033 | */ | ||
2034 | if (size > SIZE_MAX) | ||
2035 | return false; | ||
2036 | |||
2030 | mapping = arm_iommu_create_mapping(dev->bus, dma_base, size); | 2037 | mapping = arm_iommu_create_mapping(dev->bus, dma_base, size); |
2031 | if (IS_ERR(mapping)) { | 2038 | if (IS_ERR(mapping)) { |
2032 | pr_warn("Failed to create %llu-byte IOMMU mapping for device %s\n", | 2039 | pr_warn("Failed to create %llu-byte IOMMU mapping for device %s\n", |