提交 b52402c7 编写于 作者: L Lennert Buytenhek 提交者: Linus Torvalds

[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: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 fe4b334f
......@@ -266,7 +266,7 @@ static int find_resource(struct resource *root, struct resource *new,
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册