lkml.org 
[lkml]   [2006]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Make sure nobody's leaking resources

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 <matthew@wil.cx>

diff -urpNX dontdiff linus-2.6/kernel/resource.c parisc-2.6/kernel/resource.c
--- linus-2.6/kernel/resource.c 2006-03-20 07:29:06.000000000 -0700
+++ parisc-2.6/kernel/resource.c 2006-03-20 07:00:47.000000000 -0700
@@ -181,6 +181,8 @@ static int __release_resource(struct res
{
struct resource *tmp, **p;

+ BUG_ON(old->child);
+
p = &old->parent->child;
for (;;) {
tmp = *p;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-03-20 16:57    [W:0.042 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site