]> git.hungrycats.org Git - linux/commitdiff
[PATCH] insert_resource fix
authorJohn Rose <johnrose@austin.ibm.com>
Tue, 15 Jun 2004 13:19:55 +0000 (06:19 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 15 Jun 2004 13:19:55 +0000 (06:19 -0700)
I noticed that insert_resource() incorrectly handles the case of an
existing parent resource with the same ending address as a newly added
child.  This results in incorrect nesting, like the following:

# cat /proc/ioports
<snip>
002f0000-002fffff : PCI Bus #48
  00200000-002fffff : /pci@800000020000003
</snip>

Signed-off-by: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/resource.c

index f7a704e88bd1be85e457cb3c6a1b1f5b1825df3d..da0ffd601fd709df97f657a102d60e4defddf2a6 100644 (file)
@@ -332,8 +332,8 @@ int insert_resource(struct resource *parent, struct resource *new)
                if (next->sibling->start > new->end)
                        break;
 
-       /* existing resource overlaps end of new resource */
-       if (next->end > new->end) {
+       /* existing resource includes new resource */
+       if (next->end >= new->end) {
                parent = next;
                result = 0;
                goto begin;