summaryrefslogtreecommitdiff
path: root/arch/nios2
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2018-01-31 16:59:21 +1100
committerMark Brown <broonie@kernel.org>2018-02-07 11:16:39 +0000
commit3a0a7b261009a9eaebd84140e933ee579df18d0c (patch)
tree76800ddda68a2603b466322066bdf8ea19ab6e2d /arch/nios2
parent4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff)
ASoC: mt8173-rt5650: fix child-node lookup
This driver used the wrong OF-helper when looking up the optional capture-codec child node during probe. Instead of searching just children of the sound node, a tree-wide depth-first search starting at the unrelated platform node was done. Not only could this end up matching an unrelated node or no node at all; the platform node could also be prematurely freed since of_find_node_by_name() drops a reference to its first argument. This particular pattern has been observed leading to crashes after probe deferrals in other drivers. Fix this by dropping the broken call to of_find_node_by_name() and keeping only the second, correct lookup using of_get_child_by_name() while taking care not to bail out if the optional node is missing. Note that this also addresses two capture-codec node-reference leaks (one for each of the original helper calls). Compile tested only. Fixes: d349caeb0510 ("ASoC: mediatek: Add second I2S on mt8173-rt5650 machine driver") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'arch/nios2')
0 files changed, 0 insertions, 0 deletions