From 989f980f9cf2a244122df4e52efe39798485e8c9 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Tue, 11 Oct 2011 17:41:32 +0200 Subject: [PATCH] iommu/amd: Fix wrong shift direction commit fcd0861db1cf4e6ed99f60a815b7b72c2ed36ea4 upstream. The shift direction was wrong because the function takes a page number and i is the address is the loop. Signed-off-by: Joerg Roedel [PG: drivers/iommu/ was arch/x86/kernel/ in 2.6.34 context] Signed-off-by: Paul Gortmaker --- arch/x86/kernel/amd_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 1aae6178eb01..74ce61d8d476 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -1046,7 +1046,7 @@ static int alloc_new_range(struct dma_ops_domain *dma_dom, if (!pte || !IOMMU_PTE_PRESENT(*pte)) continue; - dma_ops_reserve_addresses(dma_dom, i << PAGE_SHIFT, 1); + dma_ops_reserve_addresses(dma_dom, i >> PAGE_SHIFT, 1); } update_domain(&dma_dom->domain); -- 2.39.5