diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2013-10-31 11:09:20 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-10-31 13:57:47 -0400 |
commit | 2062b4c5d2d8fa47dc89105464e67a7ba310c9e7 (patch) | |
tree | 856c4c93bd37bf0ce331c86323cee00650e0c7a2 /sound/soc/soc-pcm.c | |
parent | c5914b0aaea6494aaa9e415cbd32f8b7eb604af0 (diff) |
ASoC: dpcm: improve robustness
Avoid oopsing if there is no backend stream associated with a front end
stream.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index d81b79251760..591f0f3074c5 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -1038,6 +1038,12 @@ static int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) | |||
1038 | struct snd_pcm_substream *be_substream = | 1038 | struct snd_pcm_substream *be_substream = |
1039 | snd_soc_dpcm_get_substream(be, stream); | 1039 | snd_soc_dpcm_get_substream(be, stream); |
1040 | 1040 | ||
1041 | if (!be_substream) { | ||
1042 | dev_err(be->dev, "ASoC: no backend %s stream\n", | ||
1043 | stream ? "capture" : "playback"); | ||
1044 | continue; | ||
1045 | } | ||
1046 | |||
1041 | /* is this op for this BE ? */ | 1047 | /* is this op for this BE ? */ |
1042 | if (!snd_soc_dpcm_be_can_update(fe, be, stream)) | 1048 | if (!snd_soc_dpcm_be_can_update(fe, be, stream)) |
1043 | continue; | 1049 | continue; |
@@ -1055,7 +1061,8 @@ static int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) | |||
1055 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) | 1061 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) |
1056 | continue; | 1062 | continue; |
1057 | 1063 | ||
1058 | dev_dbg(be->dev, "ASoC: open BE %s\n", be->dai_link->name); | 1064 | dev_dbg(be->dev, "ASoC: open %s BE %s\n", |
1065 | stream ? "capture" : "playback", be->dai_link->name); | ||
1059 | 1066 | ||
1060 | be_substream->runtime = be->dpcm[stream].runtime; | 1067 | be_substream->runtime = be->dpcm[stream].runtime; |
1061 | err = soc_pcm_open(be_substream); | 1068 | err = soc_pcm_open(be_substream); |