Pull dma-mapping fix from Christoph Hellwig: "Fix an integer overflow on 32-bit platforms in the new DMA range code (Geert Uytterhoeven)" * tag 'dma-mapping-5.10-2' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: fix 32-bit overflow with CONFIG_ARM_LPAE=n
Unified · Split
| @@ -93,7 +93,7 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, · 92 unmodified lines | |||
| 93 | { | 93 | { |
| 94 | const struct iommu_ops *iommu; | 94 | const struct iommu_ops *iommu; |
| 95 | const struct bus_dma_region *map = NULL; | 95 | const struct bus_dma_region *map = NULL; |
| 96 | dma_addr_t dma_start = 0; | 96 | u64 dma_start = 0; |
| 97 | u64 mask, end, size = 0; | 97 | u64 mask, end, size = 0; |
| 98 | bool coherent; | 98 | bool coherent; |
| 99 | int ret; | 99 | int ret; |
| @@ -109,10 +109,10 @@ int of_dma_configure_id(struct device *dev, struct device_node *np, · 9 unmodified lines | |||
| 109 | return ret == -ENODEV ? 0 : ret; | 109 | return ret == -ENODEV ? 0 : ret; |
| 110 | } else { | 110 | } else { |
| 111 | const struct bus_dma_region *r = map; | 111 | const struct bus_dma_region *r = map; |
| 112 | dma_addr_t dma_end = 0; | 112 | u64 dma_end = 0; |
| 113 | 113 | ||
| 114 | /* Determine the overall bounds of all DMA regions */ | 114 | /* Determine the overall bounds of all DMA regions */ |
| 115 | for (dma_start = ~(dma_addr_t)0; r->size; r++) { | 115 | for (dma_start = ~0ULL; r->size; r++) { |
| 116 | /* Take lower and upper limits */ | 116 | /* Take lower and upper limits */ |
| 117 | if (r->dma_start < dma_start) | 117 | if (r->dma_start < dma_start) |
| 118 | dma_start = r->dma_start; | 118 | dma_start = r->dma_start; |