summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-02-01 14:01:27 +0100
committerBen Hutchings <ben@decadent.org.uk>2013-03-06 03:23:47 +0000
commit45d12e995b298e90420f0f9172c972279a3ebcee (patch)
tree8b25b28aaf1c4296f0df27a3e5087119d5401e42 /sound
parent6d6e66d90d1e9564d20060ffd03dbf75ed85c7d2 (diff)
downloadkernel-common-45d12e995b298e90420f0f9172c972279a3ebcee.tar.gz
kernel-common-45d12e995b298e90420f0f9172c972279a3ebcee.tar.bz2
kernel-common-45d12e995b298e90420f0f9172c972279a3ebcee.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: Ben Hutchings <ben@decadent.org.uk>
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 bde261500456..98e9baf3a975 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -918,8 +918,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 */