projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0cb0a8a
)
Protect __release_resource against resources without parents
author
Phil Elwell
<phil@raspberrypi.org>
Fri, 13 Mar 2015 12:43:36 +0000
(12:43 +0000)
committer
Dom Cobley
<popcornmix@gmail.com>
Mon, 19 Feb 2024 11:31:31 +0000
(11:31 +0000)
Without this patch, removing a device tree overlay can crash here.
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
kernel/resource.c
patch
|
blob
|
history
diff --git
a/kernel/resource.c
b/kernel/resource.c
index
e3f5680
..
ded9cf8
100644
(file)
--- a/
kernel/resource.c
+++ b/
kernel/resource.c
@@
-200,6
+200,12
@@
static int __release_resource(struct resource *old, bool release_child)
{
struct resource *tmp, **p, *chd;
+ if (!old->parent) {
+ WARN(old->sibling, "sibling but no parent");
+ if (old->sibling)
+ return -EINVAL;
+ return 0;
+ }
p = &old->parent->child;
for (;;) {
tmp = *p;