diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-02-01 14:01:27 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-27 09:21:11 -0800 |
commit | 32a08c1e1115ae59bea13d6e354d0d7fc5fbe2d7 (patch) | |
tree | bdd88f165c0156139465a1d956fd920ef7f89ec8 | |
parent | d451fb49065183643cc048ab9ee905e5c312219e (diff) |
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>
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index a95e1988e463..cbeeb547af60 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1100,8 +1100,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 */ |