aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@parisc-linux.org>2015-05-14 01:02:17 +0000
committerJohannes Weiner <hannes@cmpxchg.org>2015-05-14 01:02:17 +0000
commita80d9c16108f1d092cc80716968390ddc44fe640 (patch)
tree4636b9ea4fde4a7143e196ffe7950bc847dea37e
parent53d174fda1ba309d07c41183e76380a00ec05206 (diff)
downloadmm-next-a80d9c16108f1d092cc80716968390ddc44fe640.tar.gz
Releasing resources with children
What does it mean to release a resource with children? Should the children become children of the released resource's parent? Should they be released too? Should we fail the release? I bet we have no callers who expect this right now, but with insert_resource() we may get some. At the point where someone hits this BUG we can figure out what semantics we want. Signed-off-by: Matthew Wilcox <willy@parisc-linux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--kernel/resource.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 02cfa1cc84483c..86523b7d7b8f7b 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -245,6 +245,8 @@ static int __release_resource(struct resource *old)
}
}
+ WARN_ON(old->child);
+
p = &old->parent->child;
for (;;) {
tmp = *p;