linux/drivers/of
Johan Hovold 6c4c6f8946 of: add helper to lookup compatible child node
commit 36156f9241 upstream.

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: Ben Hutchings <ben@decadent.org.uk>
History 2019-02-11 17:53:40 +00:00
..
testcase-data of: Fix overflow bug in string property parsing functions 2014-11-14 15:19:58 +00:00
address.c of: fix sparse warning in of_pci_range_parser_one 2017-08-26 02:14:46 +01:00
base.c of: add helper to lookup compatible child node 2019-02-11 17:53:40 +00:00
device.c of: device: Export of_device_{get_modalias, uvent_modalias} to modules 2017-11-11 13:32:58 +00:00
fdt.c of: fdt: Fix return with value in void function 2018-03-03 15:52:29 +00: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-08-22 22:38:08 +01:00
Kconfig of/fdt: Convert FDT functions to use libfdt 2014-04-30 00:59:15 -05:00
Makefile of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
of_mdio.c of_mdio: fix node leak in of_phy_register_fixed_link error path 2017-02-23 03:54:37 +00: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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
of_pci.c of: implement pci_address_to_pio as weak function 2013-10-09 20:04:06 -05:00
of_pci_irq.c of_pci_irq: kill useless variable in of_irq_parse_pci() 2014-05-27 12:13:34 +01:00
of_private.h of: Output devicetree alias names in uevent 2013-02-06 11:06:35 +00:00
of_reserved_mem.c of: alloc anywhere from memblock if range not specified 2016-05-01 00:05:53 +02:00
pdt.c of: device_node kobject lifecycle fixes 2014-03-19 14:58:40 +00:00
platform.c of: platform: stop accessing invalid dev in of_platform_device_destroy 2018-11-20 18:05:09 +00:00
selftest.c of: unittest: Disable interrupt node tests for old world MAC systems 2018-12-16 22:09:39 +00:00