[patch 21/21] AMD IOMMU: fix wrong loop counter in free_pagetables

From: Greg KH
Date: Mon Jan 12 2009 - 20:37:26 EST


2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------

From: Joerg Roedel <joerg.roedel@xxxxxxx>

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 <joerg.roedel@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
arch/x86/kernel/amd_iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -487,7 +487,7 @@ static void dma_ops_free_pagetable(struc
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]);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/