diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2005-04-16 18:25:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:25:58 -0400 |
commit | b52402c783d8c16b11f146a244bb21086a94bf84 (patch) | |
tree | 22b6a4a3623ba2eae08113367eab8b59929f43c0 | |
parent | fe4b334f8bcdf5359771666d5002b293212e4d3f (diff) |
[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 <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/resource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 35c99ac02c7c..52f696f11adf 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -266,7 +266,7 @@ static int find_resource(struct resource *root, struct resource *new, | |||
266 | new->start = (new->start + align - 1) & ~(align - 1); | 266 | new->start = (new->start + align - 1) & ~(align - 1); |
267 | if (alignf) | 267 | if (alignf) |
268 | alignf(alignf_data, new, size, align); | 268 | alignf(alignf_data, new, size, align); |
269 | if (new->start < new->end && new->end - new->start + 1 >= size) { | 269 | if (new->start < new->end && new->end - new->start >= size - 1) { |
270 | new->end = new->start + size - 1; | 270 | new->end = new->start + size - 1; |
271 | return 0; | 271 | return 0; |
272 | } | 272 | } |