summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@parisc-linux.org>2019-07-18 00:07:42 +0000
committerJohannes Weiner <hannes@cmpxchg.org>2019-07-18 00:07:42 +0000
commit0c2b88f1af5a2363747735a4f4bc8bf0b9e4a904 (patch)
tree32f4ad0a6b0584f2cf512e4183ede720f0165c3e
parent013b1a52280b3f1ad9a19c25b456de87ad2b60e2 (diff)
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> Cc: Matthew Wilcox <willy@infradead.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 6eff1a743d8c..02ad13f53306 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -222,6 +222,8 @@ static int __release_resource(struct resource *old, bool release_child)
}
}
+ WARN_ON(old->child);
+
p = &old->parent->child;
for (;;) {
tmp = *p;