Commit 6c790212 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents c25f2fb1 81122fba
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
		}