diff options
author | Jerome Brunet <jbrunet@baylibre.com> | 2019-04-29 16:29:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-31 16:47:16 +0300 |
commit | 6d611134006ff5419b680d303b9fa05fa5138be5 (patch) | |
tree | 8dde8633fb6894edb1aedec38c6e65904d6144dd /sound | |
parent | 85339bb71af4b184639ab445306cd0a2cac54686 (diff) | |
download | linux-6d611134006ff5419b680d303b9fa05fa5138be5.tar.xz |
ASoC: hdmi-codec: unlock the device on startup errors
[ Upstream commit 30180e8436046344b12813dc954b2e01dfdcd22d ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-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 7406695ee5dc..e00f5f49f21d 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -446,8 +446,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); |