]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/arm/mm/dma-mapping.c
Merge tag 'pci-v4.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[mirror_ubuntu-zesty-kernel.git] / arch / arm / mm / dma-mapping.c
index c27447653903f1134594fe309dc885285ea43bb3..e315dfe3af1b46e4a441085a89cdff2116d5a5c8 100644 (file)
@@ -2027,6 +2027,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",