diff options
author | Jerome Brunet | 2019-04-29 15:29:39 +0200 |
---|---|---|
committer | Mark Brown | 2019-05-03 07:50:47 +0200 |
commit | 30180e8436046344b12813dc954b2e01dfdcd22d (patch) | |
tree | e57846ed8a0a3254be63705cfffa50ac10e84c60 /sound/soc/codecs/hdmi-codec.c | |
parent | ASoC: da7219: Update the support rate list (diff) | |
download | kernel-qcow2-linux-30180e8436046344b12813dc954b2e01dfdcd22d.tar.gz kernel-qcow2-linux-30180e8436046344b12813dc954b2e01dfdcd22d.tar.xz kernel-qcow2-linux-30180e8436046344b12813dc954b2e01dfdcd22d.zip |
ASoC: hdmi-codec: unlock the device on startup errors
If the hdmi codec startup fails, it should clear the current_substream
pointer to free the device. This is properly done for the audio_startup()
callback but for snd_pcm_hw_constraint_eld().
Make sure the pointer cleared if an error is reported.
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/hdmi-codec.c')
-rw-r--r-- | sound/soc/codecs/hdmi-codec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 35df73e42cbc..fb2f0ac1f16f 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -439,8 +439,12 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, if (!ret) { ret = snd_pcm_hw_constraint_eld(substream->runtime, hcp->eld); - if (ret) + if (ret) { + mutex_lock(&hcp->current_stream_lock); + hcp->current_stream = NULL; + mutex_unlock(&hcp->current_stream_lock); return ret; + } } /* Select chmap supported */ hdmi_codec_eld_chmap(hcp); |