Skip to contentSkip to conversation

insert_resource() nesting fix

PATCH New John Rose 1 participant 1 message Jun 15, 2004

lore
Share & tools
lore

John Rose

author
#0 lore raw

PATCH 1/1 insert_resource() nesting fix

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>

Thanks-
John

kernel/resource.c +2 -2
diff -Nru a/kernel/resource.c b/kernel/resource.c
@@ -332,8 +332,8 @@
 		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;