summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-15 12:37:53 +0200
committerMark Brown <broonie@linaro.org>2013-08-15 12:37:53 +0200
commit14388a69348d14fb8fb02a2cbd0512af8902e912 (patch)
treeebce31fb5aebf7373f47725f8a8ae00de8fef0ff /sound
parentMerge remote-tracking branch 'asoc/fix/cs42l52' into asoc-linus (diff)
parentASoC: dapm: Fix empty list check in dapm_new_mux() (diff)
downloadlinux-14388a69348d14fb8fb02a2cbd0512af8902e912.tar.xz
linux-14388a69348d14fb8fb02a2cbd0512af8902e912.zip
Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-dapm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index bd16010441cc..4375c9f2b791 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -679,13 +679,14 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
return -EINVAL;
}
- path = list_first_entry(&w->sources, struct snd_soc_dapm_path,
- list_sink);
- if (!path) {
+ if (list_empty(&w->sources)) {
dev_err(dapm->dev, "ASoC: mux %s has no paths\n", w->name);
return -EINVAL;
}
+ path = list_first_entry(&w->sources, struct snd_soc_dapm_path,
+ list_sink);
+
ret = dapm_create_or_share_mixmux_kcontrol(w, 0, path);
if (ret < 0)
return ret;