Skip to content

Commit 6c79021

Browse files
committed
Merge tag 'devicetree-fixes-for-6.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
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
2 parents c25f2fb + 81122fb commit 6c79021

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

drivers/of/base.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,13 +1942,17 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
19421942
end--;
19431943
len = end - start;
19441944

1945-
if (kstrtoint(end, 10, &id) < 0)
1945+
if (kstrtoint(end, 10, &id) < 0) {
1946+
of_node_put(np);
19461947
continue;
1948+
}
19471949

19481950
/* Allocate an alias_prop with enough space for the stem */
19491951
ap = dt_alloc(sizeof(*ap) + len + 1, __alignof__(*ap));
1950-
if (!ap)
1952+
if (!ap) {
1953+
of_node_put(np);
19511954
continue;
1955+
}
19521956
memset(ap, 0, sizeof(*ap) + len + 1);
19531957
ap->alias = start;
19541958
of_alias_add(ap, np, id, start, len);

drivers/of/platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static int __init of_platform_default_populate_init(void)
569569

570570
node = of_find_node_by_path("/firmware");
571571
if (node) {
572-
of_platform_populate(node, NULL, NULL, NULL);
572+
of_platform_default_populate(node, NULL, NULL);
573573
of_node_put(node);
574574
}
575575

0 commit comments

Comments
 (0)