Commit fab1beda authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'devicetree-fixes-for-6.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:

 - Fix a memory leak for of_pci_add_properties() failure case. Then fix
   the introduced UAF.

 - Add missing IORESOURCE_MEM flag on of_reserved_mem_region_to_resource()

 - Add already in use vendor prefix "eswin"

 - Clarify "of of" comment in of_match_device(). After many years of
   drive-by patches dropping the 2nd "of" (which referred to
   OpenFirmware), a correct patch finally arrived

* tag 'devicetree-fixes-for-6.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
  of: dynamic: Fix use after free in of_changeset_add_prop_helper()
  dt-bindings: vendor-prefixes: add eswin
  of: reserved_mem: Add missing IORESOURCE_MEM flag on resources
  of: dynamic: Fix memleak when of_pci_add_properties() failed
  of: Clarify OF device context in of_match_device() comment
parents b6add54b 80af3745
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -507,6 +507,8 @@ patternProperties:
    description: Espressif Systems Co. Ltd.
  "^est,.*":
    description: ESTeem Wireless Modems
  "^eswin,.*":
    description: Beijing ESWIN Technology Group Co. Ltd.
  "^ettus,.*":
    description: NI Ettus Research
  "^eukrea,.*":
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@

/**
 * of_match_device - Tell if a struct device matches an of_device_id list
 * @matches: array of of device match structures to search in
 * @dev: the of device structure to match against
 * @matches: array of of_device_id match structures to search in
 * @dev: the OF device structure to match against
 *
 * Used by a driver to check whether an platform_device present in the
 * system is in its list of supported devices.
+7 −2
Original line number Diff line number Diff line
@@ -935,12 +935,17 @@ static int of_changeset_add_prop_helper(struct of_changeset *ocs,
		return -ENOMEM;

	ret = of_changeset_add_property(ocs, np, new_pp);
	if (ret)
	if (ret) {
		__of_prop_free(new_pp);

		return ret;
	}

	new_pp->next = np->deadprops;
	np->deadprops = new_pp;

	return 0;
}

/**
 * of_changeset_add_prop_string - Add a string property to a changeset
 *
+1 −0
Original line number Diff line number Diff line
@@ -771,6 +771,7 @@ int of_reserved_mem_region_to_resource(const struct device_node *np,
		return -EINVAL;

	resource_set_range(res, rmem->base, rmem->size);
	res->flags = IORESOURCE_MEM;
	res->name = rmem->name;
	return 0;
}