tree 8b39eca8c4a63a231a6c523d309bc1ae3fa4e1bd
parent 2375783309db45ad337c4700a75d60a4cc96bd6f
author Lennert Buytenhek <[EMAIL PROTECTED]> Tue Apr 12 08:26:26 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:26:26 2005

[PATCH] pci enumeration on ixp2000: overflow in kernel/resource.c

IXP2000 (ARM-based) platforms use a separate 'struct resource' for PCI MEM
space.  Resource allocation for PCI BARs always fails because the 'root'
resource (the IXP2000 PCI MEM resource) always has the entire address space
(00000000-ffffffff) free, and find_resource() calculates the size of that
range as ffffffff-00000000+1=0, so all allocations fail because it thinks
there is no space.

(akpm: pls. double-check)

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 resource.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: kernel/resource.c
===================================================================
--- 1b2acbee67e55f93f664ed889bf48187785c0c0e/kernel/resource.c  (mode:100644 
sha1:f90e52b7899fd3398373194de665e223938151f3)
+++ 8b39eca8c4a63a231a6c523d309bc1ae3fa4e1bd/kernel/resource.c  (mode:100644 
sha1:8ad4478131bc5f76c9d2b0de515f8f73307e0825)
@@ -266,7 +266,7 @@
                new->start = (new->start + align - 1) & ~(align - 1);
                if (alignf)
                        alignf(alignf_data, new, size, align);
-               if (new->start < new->end && new->end - new->start + 1 >= size) 
{
+               if (new->start < new->end && new->end - new->start >= size - 1) 
{
                        new->end = new->start + size - 1;
                        return 0;
                }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to