From: Joerg Roedel Date: Fri, 19 Dec 2008 13:42:15 +0000 (+0100) Subject: AMD IOMMU: fix wrong loop counter in free_pagetables X-Git-Tag: v2.6.27.11~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=938d1732649548da9887c7159a1d4f95d9e11995;p=karo-tx-linux.git AMD IOMMU: fix wrong loop counter in free_pagetables Upstream commit 3cc3d84bffbd93bdb671ac7961b12cd98fbb9266 This fixes a bug which causes the driver to go in an endless loop if initialization fails and its resources are freed. Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index a1493bb3ed9e..20804d06c70b 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c @@ -487,7 +487,7 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom) continue; p2 = IOMMU_PTE_PAGE(p1[i]); - for (j = 0; j < 512; ++i) { + for (j = 0; j < 512; ++j) { if (!IOMMU_PTE_PRESENT(p2[j])) continue; p3 = IOMMU_PTE_PAGE(p2[j]);