diff options
author | Matthew Wilcox <matthew@wil.cx> | 2015-05-14 01:02:16 +0000 |
---|---|---|
committer | Johannes Weiner <hannes@cmpxchg.org> | 2015-05-14 01:02:16 +0000 |
commit | bf58172f5c32bf0eeec8b2ed78890aaeed9a7833 (patch) | |
tree | 1f48d6a72b4bb4035bdc6a751a314fbc69177934 | |
parent | 9f3958327066abcc1e08e989e945b98900056cd4 (diff) | |
download | mm-next-bf58172f5c32bf0eeec8b2ed78890aaeed9a7833.tar.gz |
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>
Cc: Greg KH <greg@kroah.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | kernel/resource.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index 90552aab5f2dd0..02cfa1cc84483c 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -237,6 +237,14 @@ static int __release_resource(struct resource *old) { struct resource *tmp, **p; + if (old->child) { + static int warned; + if (warned < 5) { + warned++; + WARN_ON(1); + } + } + p = &old->parent->child; for (;;) { tmp = *p; |