summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-02-01 14:01:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-28 06:59:02 -0800
commit63b2afe91cef7d844ea07a1ad17be63ded94e8ca (patch)
treee77081ec85422034d825f1cc2ac61887434e97cc /sound
parente32afc122e3a808944a9f7af5612bf2a3cbea89a (diff)
downloadlwn-63b2afe91cef7d844ea07a1ad17be63ded94e8ca.tar.gz
lwn-63b2afe91cef7d844ea07a1ad17be63ded94e8ca.zip
ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open()
commit 2ad779b7329d6894a80df94e693e72eaa0d56790 upstream. If the driver detects and invalid ELD, it gives an open error. But it forgot to release the assigned pin, converter and spdif ctls before returning. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_hdmi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index d1b805aefa57..f694dd77ad44 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -924,8 +924,12 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
if (!static_hdmi_pcm && eld->eld_valid) {
snd_hdmi_eld_update_pcm_info(eld, hinfo);
if (hinfo->channels_min > hinfo->channels_max ||
- !hinfo->rates || !hinfo->formats)
+ !hinfo->rates || !hinfo->formats) {
+ per_cvt->assigned = 0;
+ hinfo->nid = 0;
+ snd_hda_spdif_ctls_unassign(codec, pin_idx);
return -ENODEV;
+ }
}
/* Store the updated parameters */