linux-brain/drivers/of
Johan Hovold f3e3c50c36 of: add helper to lookup compatible child node
[ Upstream commit 36156f9241 ]

Add of_get_compatible_child() helper that can be used to lookup
compatible child nodes.

Several drivers currently use of_find_compatible_node() to lookup child
nodes while failing to notice that the of_find_ functions search the
entire tree depth-first (from a given start node) and therefore can
match unrelated nodes. The fact that these functions also drop a
reference to the node they start searching from (e.g. the parent node)
is typically also overlooked, something which can lead to use-after-free
bugs.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-01 09:46:35 +01:00
..
unittest-data of/unittest: replace 'selftest' with 'unittest' 2015-03-25 00:53:29 -05:00
Kconfig of: add config option to enable building of all dtbs 2015-10-27 16:12:13 -05:00
Makefile of: clean-up unnecessary libfdt include paths 2015-06-04 20:16:47 -05:00
address.c of: fix sparse warning in of_pci_range_parser_one 2017-05-25 14:30:10 +02:00
base.c of: add helper to lookup compatible child node 2018-12-01 09:46:35 +01:00
device.c of: fix of_device_get_modalias returned length when truncating buffers 2018-03-22 09:23:21 +01:00
dynamic.c of: fix memory leak related to safe_name() 2016-08-20 18:09:25 +02:00
fdt.c of: Add check to of_scan_flat_dt() before accessing initial_boot_params 2017-06-29 12:48:52 +02:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
irq.c of: irq: fix of_irq_get[_byname]() kernel-doc 2016-07-27 09:47:29 -07:00
of_mdio.c of_mdio: fix MDIO phy device refcounting 2015-09-24 23:04:52 -07:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
of_net.c of_net: factor out repetitive code from of_get_mac_address() 2015-03-29 08:56:17 +01:00
of_pci.c More power management and ACPI updates for v4.4-rc1 2015-11-12 11:50:33 -08:00
of_pci_irq.c of_pci_irq: Silence bogus "of_irq_parse_pci() failed ..." messages. 2015-09-17 14:46:11 -05:00
of_private.h of: fix memory leak related to safe_name() 2016-08-20 18:09:25 +02:00
of_reserved_mem.c of: silence warnings due to max() usage 2016-11-15 07:46:39 +01:00
overlay.c of/overlay: add missing of_node_put 2015-10-22 09:35:51 -05:00
pdt.c of: Eliminate of_allnodes list 2014-11-04 13:29:38 +00:00
platform.c of/platform: add missing of_node_put 2015-10-22 09:26:44 -05:00
resolver.c of/resolver: Switch to new local fixups format. 2014-11-24 22:24:50 +00:00
unittest.c of: unittest: Disable interrupt node tests for old world MAC systems 2018-10-13 09:11:33 +02:00