]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: fix OF child-node lookup
authorJohan Hovold <johan@kernel.org>
Mon, 27 Aug 2018 08:21:47 +0000 (10:21 +0200)
committerRob Herring <robh@kernel.org>
Tue, 23 Oct 2018 18:20:04 +0000 (13:20 -0500)
commit3efcef8161564b9ff68e1d5241cbe5bf37ae7b4c
treee0d0cb8bf418780afc4dd2e87d67711476e5c313
parente27ecde49929b18ee81c32e8dac07cfc7806026f
drm/msm: fix OF child-node lookup

Use the new of_get_compatible_child() helper to lookup the legacy
pwrlevels child node instead of using of_find_compatible_node(), which
searches the entire tree from a given start node and thus can return an
unrelated (i.e.  non-child) node.

This also addresses a potential use-after-free (e.g. after probe
deferral) as the tree-wide helper drops a reference to its first
argument (i.e. the probed device's node).

While at it, also fix the related child-node reference leak.

Fixes: 89ce353b2ab4 ("drm/msm: gpu: Use OPP tables if we can")
Cc: stable <stable@vger.kernel.org> # 4.12
Cc: Jordan Crouse <jcrouse@codeaurora.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/gpu/drm/msm/adreno/adreno_gpu.c