浏览代码

iommu/amd: Fix wrong shift direction

The shift direction was wrong because the function takes a
page number and i is the address is the loop.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Joerg Roedel 13 年之前
父节点
当前提交
fcd0861db1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/iommu/amd_iommu.c

+ 1 - 1
drivers/iommu/amd_iommu.c

@@ -1283,7 +1283,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);