diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-01-20 15:01:15 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-01-20 15:01:15 -0800 |
| commit | 6c790212c588fddeb0d852f2790840753bb604b1 (patch) | |
| tree | c050c01354e0d525c6892bc4c8f2fcd65f7524c5 | |
| parent | c25f2fb1f469deaed2df8db524d91f3321a0f816 (diff) | |
| parent | 81122fba08fa3ccafab6ed272a5c6f2203923a7e (diff) | |
| download | linux-master.tar.gz | |
Merge tag 'devicetree-fixes-for-6.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linuxHEADmaster
Pull devicetree fixes from Rob Herring:
- Fix a refcount leak in of_alias_scan()
- Support descending into child nodes when populating nodes
in /firmware
* tag 'devicetree-fixes-for-6.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of: fix reference count leak in of_alias_scan()
of: platform: Use default match table for /firmware
| -rw-r--r-- | drivers/of/base.c | 8 | ||||
| -rw-r--r-- | drivers/of/platform.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 0b65039ece53aa..57420806c1a2b9 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1942,13 +1942,17 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) end--; len = end - start; - if (kstrtoint(end, 10, &id) < 0) + if (kstrtoint(end, 10, &id) < 0) { + of_node_put(np); continue; + } /* Allocate an alias_prop with enough space for the stem */ ap = dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap)); - if (!ap) + if (!ap) { + of_node_put(np); continue; + } memset(ap, 0, sizeof(*ap) + len + 1); ap->alias = start; of_alias_add(ap, np, id, start, len); diff --git a/drivers/of/platform.c b/drivers/of/platform.c index f77cb19973a5d1..a6dca3a005aac9 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -569,7 +569,7 @@ static int __init of_platform_default_populate_init(void) node = of_find_node_by_path("/firmware"); if (node) { - of_platform_populate(node, NULL, NULL, NULL); + of_platform_default_populate(node, NULL, NULL); of_node_put(node); } |
