Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 853d7314 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dma-iommu: Fix off-by-one error"

parents 4eb47a07 c331dcf0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -436,7 +436,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain,
	 * rb_tree.
	 * rb_tree.
	 */
	 */
	limit = min_t(dma_addr_t, DMA_BIT_MASK(32) >> shift,
	limit = min_t(dma_addr_t, DMA_BIT_MASK(32) >> shift,
						iovad->dma_32bit_pfn);
						iovad->dma_32bit_pfn - 1);


	/* Try to get PCI devices a SAC address */
	/* Try to get PCI devices a SAC address */
	if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
	if (dma_limit > DMA_BIT_MASK(32) && dev_is_pci(dev))
@@ -444,7 +444,7 @@ static dma_addr_t iommu_dma_alloc_iova(struct iommu_domain *domain,


	if (!iova) {
	if (!iova) {
		limit = min_t(dma_addr_t, dma_limit >> shift,
		limit = min_t(dma_addr_t, dma_limit >> shift,
						iovad->dma_32bit_pfn);
						iovad->dma_32bit_pfn - 1);


		iova = alloc_iova_fast(iovad, iova_len, limit);
		iova = alloc_iova_fast(iovad, iova_len, limit);
	}
	}