Unverified Commit 30180e84 authored by Jerome Brunet's avatar Jerome Brunet Committed by Mark Brown
Browse files

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: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cd8926e3
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -439,9 +439,13 @@ 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);
	}