ASoC: hdmi-codec: unlock the device on startup errors
[sfrench/cifs-2.6.git] / sound / soc / codecs / hdmi-codec.c
index 35df73e42cbc5f9d7bf6af4aa954bde49e8565e2..fb2f0ac1f16f303e1b999441754826d7391b180c 100644 (file)
@@ -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);