[PATCH 2.6.0-test11] agpgart [amd64] fix (off by one)

From: Brad House
Date: Sun Nov 30 2003 - 14:01:55 EST


AGPGart would report "Too many northbridges" without this
patch. The problem was that 'i' was incremented before being
checked against the MAX GARTS, just making the check > instead
of == fixes the problems. Patch here:

http://dev.gentoo.org/~brad_mssw/kernel_patches/2.6.0/genpatches-0.7/101_amd64_agpgart_fix.patch


Also inlined below.
Please CC me on any replies

-Brad House
brad_mssw@xxxxxxxxxx


diff -ruN linux-2.6.0-test11.old/drivers/char/agp/amd64-agp.c
linux-2.6.0-test11/drivers/char/agp/amd64-agp.c
--- linux-2.6.0-test11.old/drivers/char/agp/amd64-agp.c 2003-11-26
15:44:44.000000000 -0500
+++ linux-2.6.0-test11/drivers/char/agp/amd64-agp.c 2003-11-30
14:07:38.690330488 -0500
@@ -357,7 +357,7 @@
}
hammers[i++] = loop_dev;
nr_garts = i;
- if (i == MAX_HAMMER_GARTS) {
+ if (nr_garts > MAX_HAMMER_GARTS) {
printk(KERN_INFO PFX "Too many northbridges for AGP\n");
return -1;
}



-
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/