summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-02-06 18:31:39 +0100
committerMark Brown <broonie@kernel.org>2019-02-06 18:31:39 +0100
commite29fe437ea5d926ea23d806b2468bf60ee8dc08a (patch)
tree958f74204fc7b15fb7a572c356bc15ac7384be01 /sound/soc/soc-core.c
parentASoC: ssm2602: switch to SPDX identifier (diff)
parentASoC: dapm: fix out-of-bounds accesses to DAPM lookup tables (diff)
downloadlinux-e29fe437ea5d926ea23d806b2468bf60ee8dc08a.tar.xz
linux-e29fe437ea5d926ea23d806b2468bf60ee8dc08a.zip
Merge branch 'asoc-5.0' into asoc-5.1 for dapm table
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8c63d32ab2fe..994d21d7ba0f 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -742,12 +742,17 @@ static struct snd_soc_component *soc_find_component(
const struct device_node *of_node, const char *name)
{
struct snd_soc_component *component;
+ struct device_node *component_of_node;
lockdep_assert_held(&client_mutex);
for_each_component(component) {
if (of_node) {
- if (component->dev->of_node == of_node)
+ component_of_node = component->dev->of_node;
+ if (!component_of_node && component->dev->parent)
+ component_of_node = component->dev->parent->of_node;
+
+ if (component_of_node == of_node)
return component;
} else if (name && strcmp(component->name, name) == 0) {
return component;
@@ -960,7 +965,7 @@ static void soc_remove_dai(struct snd_soc_dai *dai, int order)
{
int err;
- if (!dai || !dai->probed ||
+ if (!dai || !dai->probed || !dai->driver ||
dai->driver->remove_order != order)
return;