summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@parisc-linux.org>2017-12-13 01:10:35 +0000
committerJohannes Weiner <hannes@cmpxchg.org>2017-12-13 01:10:35 +0000
commit8c781e26d63628517824d5d5218e76c2e38da91a (patch)
tree9a0f1f9d6f2cedca137cedc6b86e65187cc4e2e6
parent10ef15663386bb83fd90bac91622da65224200b6 (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 <mawilcox@microsoft.com> 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 173c9fd242e6..f9c18a3f8c5e 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -254,6 +254,8 @@ static int __release_resource(struct resource *old, bool release_child)
}
}
+ WARN_ON(old->child);
+
p = &old->parent->child;
for (;;) {
tmp = *p;