summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2019-04-01 15:03:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-08 07:22:57 +0200
commit258604e0a15f25f764901e68a5a22b645666f4d8 (patch)
tree93a5f153461edfd5b7fb6cea9572c235649f52fd
parent934955968fa611706f3f2f06cdbda856b2813420 (diff)
downloadlinux-stable-258604e0a15f25f764901e68a5a22b645666f4d8.tar.gz
linux-stable-258604e0a15f25f764901e68a5a22b645666f4d8.tar.bz2
linux-stable-258604e0a15f25f764901e68a5a22b645666f4d8.zip
ASoC: dpcm: skip missing substream while applying symmetry
commit 6246f283d5e02ac757bd8d9bacde8fdc54c4582d upstream. If for any reason, the backend does not have the requested substream (like capture on a playback only backend), the BE will be skipped in dpcm_be_dai_startup(). However, dpcm_apply_symmetry() does not skip those BE and will dereference the be_substream (NULL) pointer anyway. Like in dpcm_be_dai_startup(), just skip those BE. Fixes: 906c7d690c3b ("ASoC: dpcm: Apply symmetry for DPCM") Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/soc/soc-pcm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 03f36e534050..0c1dd6bd67ab 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1895,10 +1895,15 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream,
struct snd_soc_pcm_runtime *be = dpcm->be;
struct snd_pcm_substream *be_substream =
snd_soc_dpcm_get_substream(be, stream);
- struct snd_soc_pcm_runtime *rtd = be_substream->private_data;
+ struct snd_soc_pcm_runtime *rtd;
struct snd_soc_dai *codec_dai;
int i;
+ /* A backend may not have the requested substream */
+ if (!be_substream)
+ continue;
+
+ rtd = be_substream->private_data;
if (rtd->dai_link->be_hw_params_fixup)
continue;