Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
[pandora-kernel.git] / arch / arm / mm / dma-mapping.c
index 3866f81..09c5fe3 100644 (file)
@@ -2057,6 +2057,13 @@ static bool arm_setup_iommu_dma_ops(struct device *dev, u64 dma_base, u64 size,
        if (!iommu)
                return false;
 
+       /*
+        * currently arm_iommu_create_mapping() takes a max of size_t
+        * for size param. So check this limit for now.
+        */
+       if (size > SIZE_MAX)
+               return false;
+
        mapping = arm_iommu_create_mapping(dev->bus, dma_base, size);
        if (IS_ERR(mapping)) {
                pr_warn("Failed to create %llu-byte IOMMU mapping for device %s\n",