From: Matthew Wilcox Currently, releasing a resource also releases all of its children. That made sense when request_resource was the main method of dividing up the memory map. With the increased use of insert_resource, it seems to me that we should instead reparent the newly orphaned resources. Before we do that, let's make sure that nobody's actually relying on the current semantics. Signed-off-by: Matthew Wilcox Cc: Greg KH Cc: Ivan Kokshaysky Cc: Dominik Brodowski Signed-off-by: Andrew Morton --- kernel/resource.c | 8 ++++++++ 1 files changed, 8 insertions(+) diff -puN kernel/resource.c~make-sure-nobodys-leaking-resources kernel/resource.c --- devel/kernel/resource.c~make-sure-nobodys-leaking-resources 2006-05-11 15:18:52.000000000 -0700 +++ devel-akpm/kernel/resource.c 2006-05-11 15:18:52.000000000 -0700 @@ -190,6 +190,14 @@ static int __release_resource(struct res { struct resource *tmp, **p; + if (old->child) { + static int warned; + if (warned < 5) { + warned++; + WARN_ON(1); + } + } + p = &old->parent->child; for (;;) { tmp = *p; _