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

From: Brad House (brad_mssw_at_gentoo.org)
Date: 11/30/03

  • Next message: David S. Miller: "Re: 2.4.23 and CONFIG_PROC_FS=n"
    Date:	Sun, 30 Nov 2003 14:14:54 -0500 (EST)
    To: <linux-kernel@vger.kernel.org>
    
    

    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@gentoo.org

    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@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: David S. Miller: "Re: 2.4.23 and CONFIG_PROC_FS=n"

    Relevant Pages

    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [CFT][PATCH] 2.6.4-rc1 remove x86 boot page tables
      ... > For VISWS I think you actually need to turn paging off explicitly. ... The patch will need a few tweaks but it should be fairly straight forward. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] clarify message and give support contact for non-GPL modules
      ... The author of the second module ... So here is another attempt at the patch. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: [PATCH 4/5] random periodicity detection fix
      ... >> WAY overestimating input entropy. ... > My patch did the opposite of your patch: ... 5/5 is a step in that direction, but the filtering is ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)