https://github.com/torvalds/linux
Revision 36156f9241cb0f9e37d998052873ca7501ad4b36 authored by Johan Hovold on 27 August 2018, 08:21:45 UTC, committed by Rob Herring on 29 August 2018, 13:06:46 UTC
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>
1 parent 5b394b2
History
Tip revision: 36156f9241cb0f9e37d998052873ca7501ad4b36 authored by Johan Hovold on 27 August 2018, 08:21:45 UTC
of: add helper to lookup compatible child node
Tip revision: 36156f9
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 12.8 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 31 bytes
.gitattributes -rw-r--r-- 30 bytes
.gitignore -rw-r--r-- 1.5 KB
.mailmap -rw-r--r-- 9.7 KB
COPYING -rw-r--r-- 423 bytes
CREDITS -rw-r--r-- 96.4 KB
Kbuild -rw-r--r-- 2.2 KB
Kconfig -rw-r--r-- 563 bytes
MAINTAINERS -rw-r--r-- 458.4 KB
Makefile -rw-r--r-- 59.0 KB
README -rw-r--r-- 800 bytes

README

back to top